blob: 7286f1e1145159a39398cc589081d9d1f4dcb8d2 [file] [log] [blame]
adamdunkelsb27d85a2003-09-01 22:23:26 +00001/**
adamdunkelse937ded2003-10-01 07:53:57 +00002 * \addtogroup ctk
3 * @{
4 */
5
6/**
adamdunkelsb27d85a2003-09-01 22:23:26 +00007 * \file
8 * CTK header file.
9 * \author Adam Dunkels <adam@dunkels.com>
10 *
11 * The CTK header file contains functioin declarations and definitions
12 * of CTK structures and macros.
13 */
14
adamdunkelsca9ddcb2003-03-19 14:13:31 +000015/*
adamdunkelsb27d85a2003-09-01 22:23:26 +000016 * Copyright (c) 2002-2003, Adam Dunkels.
adamdunkelsca9ddcb2003-03-19 14:13:31 +000017 * All rights reserved.
18 *
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions
21 * are met:
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 * 2. Redistributions in binary form must reproduce the above
25 * copyright notice, this list of conditions and the following
26 * disclaimer in the documentation and/or other materials provided
27 * with the distribution.
adamdunkelsb27d85a2003-09-01 22:23:26 +000028 * 3. The name of the author may not be used to endorse or promote
adamdunkelsca9ddcb2003-03-19 14:13:31 +000029 * products derived from this software without specific prior
30 * written permission.
31 *
32 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
33 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
36 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
38 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
39 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
40 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 *
adamdunkelsb27d85a2003-09-01 22:23:26 +000044 * This file is part of the Contiki desktop OS.
adamdunkelsca9ddcb2003-03-19 14:13:31 +000045 *
adamdunkelse937ded2003-10-01 07:53:57 +000046 * $Id: ctk.h,v 1.18 2003/10/01 07:53:57 adamdunkels Exp $
adamdunkelsca9ddcb2003-03-19 14:13:31 +000047 *
48 */
49
50#ifndef __CTK_H__
51#define __CTK_H__
52
adamdunkelsa6557e42003-08-11 22:27:51 +000053
adamdunkelsca9ddcb2003-03-19 14:13:31 +000054#include "ctk-conf.h"
adamdunkelsa6557e42003-08-11 22:27:51 +000055#include "ctk-arch.h"
adamdunkelsca9ddcb2003-03-19 14:13:31 +000056#include "ek.h"
57
adamdunkels78c03dc2003-04-09 13:45:05 +000058#include "cc.h"
59
adamdunkelsca9ddcb2003-03-19 14:13:31 +000060/* Defintions for the CTK widget types. */
adamdunkelsb27d85a2003-09-01 22:23:26 +000061
adamdunkelse937ded2003-10-01 07:53:57 +000062/**
63 * \addtogroup ctkdraw
64 * @{
65 */
66
67/** Widget number: The CTK separator widget. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +000068#define CTK_WIDGET_SEPARATOR 1
adamdunkelse937ded2003-10-01 07:53:57 +000069/** Widget number: The CTK label widget. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +000070#define CTK_WIDGET_LABEL 2
adamdunkelse937ded2003-10-01 07:53:57 +000071/** Widget number: The CTK button widget. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +000072#define CTK_WIDGET_BUTTON 3
adamdunkelse937ded2003-10-01 07:53:57 +000073/** Widget number: The CTK hyperlink widget. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +000074#define CTK_WIDGET_HYPERLINK 4
adamdunkelse937ded2003-10-01 07:53:57 +000075/** Widget number: The CTK textentry widget. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +000076#define CTK_WIDGET_TEXTENTRY 5
adamdunkelse937ded2003-10-01 07:53:57 +000077/** Widget number: The CTK bitmap widget. */
adamdunkels1d5eb5e2003-03-28 12:10:39 +000078#define CTK_WIDGET_BITMAP 6
adamdunkelse937ded2003-10-01 07:53:57 +000079/** Widget number: The CTK icon widget. */
adamdunkels1d5eb5e2003-03-28 12:10:39 +000080#define CTK_WIDGET_ICON 7
adamdunkelsca9ddcb2003-03-19 14:13:31 +000081
adamdunkelse937ded2003-10-01 07:53:57 +000082/** @} */
83
adamdunkelsca9ddcb2003-03-19 14:13:31 +000084struct ctk_widget;
85
adamdunkelsb27d85a2003-09-01 22:23:26 +000086/**
adamdunkelse937ded2003-10-01 07:53:57 +000087 * \defgroup ctkappfunc CTK application functions
88 * @{
89 *
90 * The CTK functions used by an application program.
91 */
92
93/**
adamdunkelsb27d85a2003-09-01 22:23:26 +000094 * Instantiating macro for the ctk_separator widget.
95 *
96 * This macro is used when instantiating a ctk_separator widget and is
97 * intended to be used together with a struct assignment like this:
98 \code
99 struct ctk_separator sep =
100 {CTK_SEPARATOR(0, 0, 23)};
101 \endcode
adamdunkelsb27d85a2003-09-01 22:23:26 +0000102 * \param x The x position of the widget, relative to the widget's
103 * window.
104 * \param y The y position of the widget, relative to the widget's
105 * window.
adamdunkelse937ded2003-10-01 07:53:57 +0000106 * \param w The widget's width.
adamdunkelsb27d85a2003-09-01 22:23:26 +0000107 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000108#define CTK_SEPARATOR(x, y, w) \
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000109 NULL, NULL, x, y, CTK_WIDGET_SEPARATOR, w, 1
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000110struct ctk_separator {
111 struct ctk_widget *next;
112 struct ctk_window *window;
113 unsigned char x, y;
114 unsigned char type;
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000115 unsigned char w, h;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000116};
117
adamdunkelsb27d85a2003-09-01 22:23:26 +0000118/**
119 * Instantiating macro for the ctk_button widget.
120 *
121 * This macro is used when instantiating a ctk_button widget and is
122 * intended to be used together with a struct assignment like this:
123 \code
124 struct ctk_button but =
125 {CTK_BUTTON(0, 0, 2, "Ok")};
126 \endcode
adamdunkelsb27d85a2003-09-01 22:23:26 +0000127 * \param x The x position of the widget, relative to the widget's
128 * window.
129 * \param y The y position of the widget, relative to the widget's
130 * window.
adamdunkelse937ded2003-10-01 07:53:57 +0000131 * \param w The widget's width.
132 * \param text The button text.
adamdunkelsb27d85a2003-09-01 22:23:26 +0000133 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000134#define CTK_BUTTON(x, y, w, text) \
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000135 NULL, NULL, x, y, CTK_WIDGET_BUTTON, w, 1, text
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000136struct ctk_button {
137 struct ctk_widget *next;
138 struct ctk_window *window;
139 unsigned char x, y;
140 unsigned char type;
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000141 unsigned char w, h;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000142 char *text;
143};
144
adamdunkelsb27d85a2003-09-01 22:23:26 +0000145/**
146 * Instantiating macro for the ctk_label widget.
147 *
148 * This macro is used when instantiating a ctk_label widget and is
149 * intended to be used together with a struct assignment like this:
150 \code
151 struct ctk_label lab =
152 {CTK_LABEL(0, 0, 5, 1, "Label")};
153 \endcode
adamdunkelsb27d85a2003-09-01 22:23:26 +0000154 * \param x The x position of the widget, relative to the widget's
155 * window.
156 * \param y The y position of the widget, relative to the widget's
157 * window.
adamdunkelse937ded2003-10-01 07:53:57 +0000158 * \param w The widget's width.
159 * \param h The height of the label.
160 * \param text The label text.
adamdunkelsb27d85a2003-09-01 22:23:26 +0000161 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000162#define CTK_LABEL(x, y, w, h, text) \
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000163 NULL, NULL, x, y, CTK_WIDGET_LABEL, w, h, text,
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000164struct ctk_label {
165 struct ctk_widget *next;
166 struct ctk_window *window;
167 unsigned char x, y;
168 unsigned char type;
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000169 unsigned char w, h;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000170 char *text;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000171};
172
adamdunkelsb27d85a2003-09-01 22:23:26 +0000173/**
174 * Instantiating macro for the ctk_hyperlink widget.
175 *
176 * This macro is used when instantiating a ctk_hyperlink widget and is
177 * intended to be used together with a struct assignment like this:
178 \code
179 struct ctk_hyperlink hlink =
180 {CTK_HYPERLINK(0, 0, 7, "Contiki", "http://dunkels.com/adam/contiki/")};
181 \endcode
adamdunkelsb27d85a2003-09-01 22:23:26 +0000182 * \param x The x position of the widget, relative to the widget's
183 * window.
184 * \param y The y position of the widget, relative to the widget's
185 * window.
adamdunkelse937ded2003-10-01 07:53:57 +0000186 * \param w The widget's width.
187 * \param text The hyperlink text.
188 * \param url The hyperlink URL.
adamdunkelsb27d85a2003-09-01 22:23:26 +0000189 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000190#define CTK_HYPERLINK(x, y, w, text, url) \
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000191 NULL, NULL, x, y, CTK_WIDGET_HYPERLINK, w, 1, text, url
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000192struct ctk_hyperlink {
193 struct ctk_widget *next;
194 struct ctk_window *window;
195 unsigned char x, y;
196 unsigned char type;
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000197 unsigned char w, h;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000198 char *text;
199 char *url;
200};
201
202/* Editing modes of the CTK textentry widget. */
adamdunkelsb27d85a2003-09-01 22:23:26 +0000203#define CTK_TEXTENTRY_NORMAL 0 /**< \internal Textentry state: not
204 edited. */
205#define CTK_TEXTENTRY_EDIT 1 /**< \internal Textentry state:
206 currenly being edited. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000207
adamdunkelsb27d85a2003-09-01 22:23:26 +0000208/**
209 * Clears a text entry widget and sets the cursor to the start of the
210 * text line.
211 *
212 * \param e The text entry widget to be cleared.
213 */
adamdunkels6e04e1a2003-08-20 20:55:35 +0000214#define CTK_TEXTENTRY_CLEAR(e) do {memset((e)->text, 0, (e)->len); (e)->xpos = 0;} while(0);
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000215
adamdunkelsb27d85a2003-09-01 22:23:26 +0000216/**
217 * Instantiating macro for the ctk_textentry widget.
218 *
219 * This macro is used when instantiating a ctk_textentry widget and is
220 * intended to be used together with a struct assignment like this:
221 \code
222 struct ctk_textentry tentry =
223 {CTK_TEXTENTRY(0, 0, 30, 1, textbuffer, 50)};
224 \endcode
225 * \note The height of the text entry widget is obsolete and not
226 * intended to be used.
227 *
adamdunkelsb27d85a2003-09-01 22:23:26 +0000228 * \param x The x position of the widget, relative to the widget's
229 * window.
230 * \param y The y position of the widget, relative to the widget's
231 * window.
adamdunkelse937ded2003-10-01 07:53:57 +0000232 * \param w The widget's width.
233 * \param h The text entry height (obsolete).
234 * \param text A pointer to the buffer that should be edited.
235 * \param len The length of the text buffer
adamdunkelsb27d85a2003-09-01 22:23:26 +0000236 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000237#define CTK_TEXTENTRY(x, y, w, h, text, len) \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000238 NULL, NULL, x, y, CTK_WIDGET_TEXTENTRY, w, 1, text, len, \
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000239 CTK_TEXTENTRY_NORMAL, 0, 0
240struct ctk_textentry {
241 struct ctk_widget *next;
242 struct ctk_window *window;
243 unsigned char x, y;
244 unsigned char type;
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000245 unsigned char w, h;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000246 char *text;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000247 unsigned char len;
248 unsigned char state;
249 unsigned char xpos, ypos;
250};
251
252
adamdunkelsb27d85a2003-09-01 22:23:26 +0000253/**
254 * Instantiating macro for the ctk_icon widget.
255 *
256 * This macro is used when instantiating a ctk_icon widget and is
257 * intended to be used together with a struct assignment like this:
258 \code
259 struct ctk_icon icon =
260 {CTK_ICON("An icon", bitmapptr, textmapptr)};
261 \endcode
262 * \param title The icon's text.
263 * \param bitmap A pointer to the icon's bitmap image.
264 * \param textmap A pointer to the icon's text version of the bitmap.
265 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000266#define CTK_ICON(title, bitmap, textmap) \
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000267 NULL, NULL, 0, 0, CTK_WIDGET_ICON, 2, 4, title, 0, bitmap, textmap
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000268struct ctk_icon {
269 struct ctk_widget *next;
270 struct ctk_window *window;
271 unsigned char x, y;
272 unsigned char type;
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000273 unsigned char w, h;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000274 char *title;
275 ek_id_t owner;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000276 unsigned char *bitmap;
277 char *textmap;
278};
279
280#define CTK_BITMAP(x, y, w, h, bitmap) \
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000281 NULL, NULL, x, y, CTK_WIDGET_BITMAP, w, h, bitmap,
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000282struct ctk_bitmap {
283 struct ctk_widget *next;
284 struct ctk_window *window;
285 unsigned char x, y;
286 unsigned char type;
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000287 unsigned char w, h;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000288 unsigned char *bitmap;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000289};
290
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000291#define CTK_TEXTMAP_NORMAL 0
292#define CTK_TEXTMAP_ACTIVE 1
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000293
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000294#define CTK_TEXTMAP(x, y, w, h, textmap, flags) \
295 NULL, NULL, x, y, CTK_WIDGET_LABEL, w, h, text, flags, CTK_TEXTMAP_NORMAL
296struct ctk_textmap {
297 struct ctk_widget *next;
298 struct ctk_window *window;
299 unsigned char x, y;
300 unsigned char type;
301 unsigned char w, h;
302 char *textmap;
303 unsigned char flags;
304 unsigned char state;
305};
306
307
adamdunkelsb27d85a2003-09-01 22:23:26 +0000308/**
309 * \internal The CTK button widget structure.
310 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000311struct ctk_widget_button {
adamdunkelsb27d85a2003-09-01 22:23:26 +0000312 char *text; /**< The button text. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000313};
314
adamdunkelsb27d85a2003-09-01 22:23:26 +0000315/**
316 * \internal The CTK label widget structure.
317 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000318struct ctk_widget_label {
adamdunkelsb27d85a2003-09-01 22:23:26 +0000319 char *text; /**< The label text. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000320};
321
adamdunkelsb27d85a2003-09-01 22:23:26 +0000322/**
323 * \internal The CTK hyperlink widget structure.
324 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000325struct ctk_widget_hyperlink {
adamdunkelsb27d85a2003-09-01 22:23:26 +0000326 char *text; /**< The text of the hyperlink. */
327 char *url; /**< The hyperlink's URL. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000328};
329
330struct ctk_widget_textentry {
331 char *text;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000332 unsigned char len;
333 unsigned char state;
334 unsigned char xpos, ypos;
335};
336
337struct ctk_widget_icon {
338 char *title;
339 ek_id_t owner;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000340 unsigned char *bitmap;
341 char *textmap;
342};
343
344struct ctk_widget_bitmap {
345 unsigned char *bitmap;
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000346};
adamdunkelse937ded2003-10-01 07:53:57 +0000347/** @} */
348
349/**
350 * \addtogroup ctkdraw
351 * @{
352 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000353
adamdunkelsb27d85a2003-09-01 22:23:26 +0000354/**
355 * The generic CTK widget structure that contains all other widget
356 * structures.
357 *
358 * Since the widgets of a window are arranged on a linked list, the
359 * widget structure contains a next pointer which is used for this
360 * purpose. The widget structure also contains the placement and the
361 * size of the widget.
362 *
363 * Finally, the actual per-widget structure is contained in this
364 * top-level widget structure.
365 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000366struct ctk_widget {
adamdunkelsb27d85a2003-09-01 22:23:26 +0000367 struct ctk_widget *next; /**< The next widget in the linked list
368 of widgets that is contained in the
369 ctk_window structure. */
370 struct ctk_window *window; /**< The window in which the widget is
371 contained. */
372 unsigned char x, /**< The x position of the widget within
373 the containing window, in character
374 coordinates. */
375 y; /**< The y position of the widget within
376 the containing window, in character
377 coordinates. */
378 unsigned char type; /**< The type of the widget:
379 CTK_WIDGET_SEPARATOR,
380 CTK_WIDGET_LABEL, CTK_WIDGET_BUTTON,
381 CTK_WIDGET_HYPERLINK,
382 CTK_WIDGET_TEXTENTRY,
383 CTK_WIDGET_BITMAP or
384 CTK_WIDGET_ICON. */
385 unsigned char w, /**< The width of the widget in character
386 coordinates. */
387 h; /**< The height of the widget in
388 character coordinates. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000389 union {
390 struct ctk_widget_label label;
391 struct ctk_widget_button button;
392 struct ctk_widget_hyperlink hyperlink;
393 struct ctk_widget_textentry textentry;
394 struct ctk_widget_icon icon;
adamdunkels1d5eb5e2003-03-28 12:10:39 +0000395 struct ctk_widget_bitmap bitmap;
adamdunkelsb27d85a2003-09-01 22:23:26 +0000396 } widget; /**< The union which contains the actual
397 widget structure, as determined by the
398 type field. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000399};
400
adamdunkelse937ded2003-10-01 07:53:57 +0000401
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000402struct ctk_desktop;
403
adamdunkelsb27d85a2003-09-01 22:23:26 +0000404/**
adamdunkelse937ded2003-10-01 07:53:57 +0000405 * Representation of a CTK window.
adamdunkelsb27d85a2003-09-01 22:23:26 +0000406 *
407 * For the CTK, each window is repessented by a ctk_window
408 * structure. All open windows are kept on a doubly linked list,
409 * linked by the next and prev fields in the ctk_window struct. The
410 * window structure holds all widgets that is contained in the window
411 * as well as a pointer to the currently selected widget.
412 *
413 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000414struct ctk_window {
adamdunkelsb27d85a2003-09-01 22:23:26 +0000415 struct ctk_window *next, /**< The next window in the doubly linked
416 list of open windows. */
417
418 *prev; /**< The previous window in the doubly
419 linked list of open windows. */
420 struct ctk_desktop *desktop;/**< The desktop on which this window is
421 open. */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000422
adamdunkelsb27d85a2003-09-01 22:23:26 +0000423 ek_id_t owner; /**< The process that owns the
424 window. This process will be the
425 receiver of all CTK signals that
426 pertain to this window. */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000427
adamdunkelsb27d85a2003-09-01 22:23:26 +0000428 char *title; /**< The title of the window. Used for
429 constructing the "Dekstop" menu. */
430 unsigned char titlelen; /**< The length of the title, cached for
431 speed reasons. */
adamdunkels1d5eb5e2003-03-28 12:10:39 +0000432
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000433#if CTK_CONF_WINDOWCLOSE
adamdunkelsb27d85a2003-09-01 22:23:26 +0000434 struct ctk_button closebutton; /**< The closebutton. This is also
435 present in the list of active
436 widgets. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000437#else /* CTK_CONF_WINDOWCLOSE */
438 struct ctk_label closebutton;
439#endif /* CTK_CONF_WINDOWCLOSE */
440
441#if CTK_CONF_WINDOWMOVE
adamdunkelsb27d85a2003-09-01 22:23:26 +0000442 struct ctk_button titlebutton;/**< The titlebutton which is used for
443 moving the window. This is also
444 present in the list of active
445 widgets. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000446#else /* CTK_CONF_WINDOWMOVE */
447 struct ctk_label titlebutton;
448#endif /* CTK_CONF_WINDOWMOVE */
449
adamdunkelsb27d85a2003-09-01 22:23:26 +0000450 unsigned char x, /**< The x coordinate of the window, in
451 characters. */
452 y; /**< The y coordinate of the window, in
453 characters. */
454 unsigned char w, /**< The width of the window, excluding
455 window borders. */
456 h; /**< The height of the window,
457 excluding window borders. */
adamdunkels1d5eb5e2003-03-28 12:10:39 +0000458
459
adamdunkelsb27d85a2003-09-01 22:23:26 +0000460 struct ctk_widget *inactive; /**< The list if widgets that cannot be
461 selected by the user. Labels and
462 separator widgets are placed on this
463 list. */
464 struct ctk_widget *active; /**< The list of widgets that can be
465 selected by the user. Buttons,
466 hyperlinks, text entry fields, etc.,
467 are placed on this list. */
468 struct ctk_widget *focused; /**< A pointer to the widget on the
469 active list that is currently
470 selected, or NULL if no widget is
471 selected. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000472};
473
adamdunkelsb27d85a2003-09-01 22:23:26 +0000474/**
adamdunkelse937ded2003-10-01 07:53:57 +0000475 * Representation of an individual menu item.
adamdunkelsb27d85a2003-09-01 22:23:26 +0000476 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000477struct ctk_menuitem {
adamdunkelsb27d85a2003-09-01 22:23:26 +0000478 char *title; /**< The menu items text. */
479 unsigned char titlelen;/**< The length of the item text, cached for
480 speed. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000481};
482
adamdunkelsb27d85a2003-09-01 22:23:26 +0000483/**
adamdunkelse937ded2003-10-01 07:53:57 +0000484 * Representation of an individual menu.
adamdunkelsb27d85a2003-09-01 22:23:26 +0000485 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000486struct ctk_menu {
adamdunkelsb27d85a2003-09-01 22:23:26 +0000487 struct ctk_menu *next; /**< Apointer to the next menu, or is NULL if
488 this is the last menu, and should be used
489 by the ctk-draw module when stepping
490 through the menus when drawing them on
491 screen. */
492 char *title; /**< The menu title. */
493 unsigned char titlelen;/**< The length of the title in
494 characters. Cached for speed reasons. */
adamdunkels78c03dc2003-04-09 13:45:05 +0000495#if CC_UNSIGNED_CHAR_BUGS
adamdunkels6ccf7212003-04-10 07:04:45 +0000496 unsigned int nitems;
497 unsigned int active;
adamdunkels78c03dc2003-04-09 13:45:05 +0000498#else /* CC_UNSIGNED_CHAR_BUGS */
adamdunkelsb27d85a2003-09-01 22:23:26 +0000499 unsigned char nitems; /**< The total number of menu items in the
500 menu. */
501 unsigned char active; /**< The currently active menu item. */
adamdunkels78c03dc2003-04-09 13:45:05 +0000502#endif /* CC_UNSIGNED_CHAR_BUGS */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000503 struct ctk_menuitem items[CTK_CONF_MAXMENUITEMS];
adamdunkelsb27d85a2003-09-01 22:23:26 +0000504 /**< The array which contains all the menu
505 items. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000506};
507
adamdunkelsb27d85a2003-09-01 22:23:26 +0000508/**
adamdunkelse937ded2003-10-01 07:53:57 +0000509 * Representation of the menu bar.
adamdunkelsb27d85a2003-09-01 22:23:26 +0000510 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000511struct ctk_menus {
adamdunkelsb27d85a2003-09-01 22:23:26 +0000512 struct ctk_menu *menus; /**< A pointer to a linked list of all
513 menus, including the open menu and
514 the desktop menu.*/
515 struct ctk_menu *open; /**< The currently open menu, if
516 any. If all menus are closed, this
517 item is NULL: */
518 struct ctk_menu *desktopmenu; /**< A pointer to the "Desktop" menu
519 that can be used for drawing the
520 desktop menu in a special way (such
521 as drawing it at the rightmost
522 position). */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000523};
524
adamdunkelse937ded2003-10-01 07:53:57 +0000525/** @} */
526
527
adamdunkelsb27d85a2003-09-01 22:23:26 +0000528/**
529 * \internal The structure describing a Contiki desktop.
530 */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000531struct ctk_desktop {
adamdunkelsb27d85a2003-09-01 22:23:26 +0000532 char *name; /**< The name of the desktop. */
533
534 struct ctk_window desktop_window; /**< The background window which
535 contains tha desktop icons. */
536 struct ctk_window *windows; /**< The list of open windows. */
537 struct ctk_window *dialog; /**< A pointer to the open dialog, or
538 NULL if no dialog is open. */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000539
540#if CTK_CONF_MENUS
adamdunkelsb27d85a2003-09-01 22:23:26 +0000541 struct ctk_menus menus; /**< The list of desktop menus. */
542 struct ctk_menu *lastmenu; /**< Pointer to the menu that was last open. */
543 struct ctk_menu desktopmenu;/**< The desktop menu. */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000544#endif /* CTK_CONF_MENUS */
545
adamdunkelsb27d85a2003-09-01 22:23:26 +0000546 unsigned char height, /**< The height of the desktop, in characters. */
547 width; /**< The width of the desktop, in characters. */
548
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000549
adamdunkelsb27d85a2003-09-01 22:23:26 +0000550#define CTK_REDRAW_NONE 0 /**< \internal Redraw flag: nothing
551 to be redrawn. */
552#define CTK_REDRAW_ALL 1 /**< \internal Redraw flag:
553 everything should be redrawn. */
554#define CTK_REDRAW_WINDOWS 2 /**< \internal Redraw flag: redraw
555 windows in queue.*/
556#define CTK_REDRAW_WIDGETS 4 /**< \internal Redraw flag: redraw
557 widgets in queue. */
558#define CTK_REDRAW_MENUS 8 /**< \internal Redraw flag: redraw
559 menus. */
560#define CTK_REDRAW_PART 16 /**< \internal Redraw flag: redraw
561 parts of the desktop. */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000562
563#ifndef CTK_CONF_MAX_REDRAWWIDGETS
564#define CTK_CONF_MAX_REDRAWWIDGETS 8
565#endif /* CTK_CONF_MAX_REDRAWWIDGETS */
566#ifndef CTK_CONF_MAX_REDRAWWINDOWS
567#define CTK_CONF_MAX_REDRAWWINDOWS 8
568#endif /* CTK_CONF_MAX_REDRAWWINDOWS */
569
adamdunkelsb27d85a2003-09-01 22:23:26 +0000570 unsigned char redraw; /**< The redraw flag. */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000571
adamdunkelsb27d85a2003-09-01 22:23:26 +0000572 struct ctk_widget *redraw_widgets[CTK_CONF_MAX_REDRAWWIDGETS]; /**< The list of widgets to be redrawn. */
573 unsigned char redraw_widgetptr; /**< Pointer to the last widget on the redraw_widgets list. */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000574
adamdunkelsb27d85a2003-09-01 22:23:26 +0000575 struct ctk_window *redraw_windows[CTK_CONF_MAX_REDRAWWINDOWS]; /**< The list of windows to be redrawn. */
576 unsigned char redraw_windowptr; /**< Pointer to the last window on the redraw_windows list. */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000577
adamdunkelsb27d85a2003-09-01 22:23:26 +0000578 unsigned char redraw_y1, /**< The lower y bound of the area to be redrawn if CTK_REDRAW_PART is flagged. */
579 redraw_y2; /**< The upper y bound of the area to be redrawn if CTK_REDRAW_PART is flagged. */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000580};
581
582
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000583/* Global CTK modes. */
584#define CTK_MODE_NORMAL 0
585#define CTK_MODE_WINDOWMOVE 1
586#define CTK_MODE_SCREENSAVER 2
587#define CTK_MODE_EXTERNAL 3
588
589/* General ctk functions. */
590void ctk_init(void);
591void ctk_mode_set(unsigned char mode);
592unsigned char ctk_mode_get(void);
adamdunkels9795b2e2003-08-09 23:32:37 +0000593/*void ctk_redraw(void);*/
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000594
595/* Functions for manipulating windows. */
596void ctk_window_new(struct ctk_window *window,
597 unsigned char w, unsigned char h,
598 char *title);
599void ctk_window_clear(struct ctk_window *w);
600void ctk_window_open(struct ctk_window *w);
601#define ctk_window_move(w,xpos,ypos) do {(w)->x=xpos; (w)->y=ypos;}while(0)
602void ctk_window_close(struct ctk_window *w);
603void ctk_window_redraw(struct ctk_window *w);
604#define ctk_window_isopen(w) ((w)->next != NULL)
605
606
607/* Functions for manipulating dialogs. */
608void ctk_dialog_new(struct ctk_window *window,
609 unsigned char w, unsigned char h);
610void ctk_dialog_open(struct ctk_window *d);
611void ctk_dialog_close(void);
612
613/* Functions for manipulating menus. */
614void ctk_menu_new(struct ctk_menu *menu, char *title);
615void ctk_menu_add(struct ctk_menu *menu);
616void ctk_menu_remove(struct ctk_menu *menu);
617unsigned char ctk_menuitem_add(struct ctk_menu *menu, char *name);
618
619/* Functions for icons. */
adamdunkelse937ded2003-10-01 07:53:57 +0000620
621/**
622 * \addtogroup ctkappfunc
623 * @{
624 */
adamdunkelsb27d85a2003-09-01 22:23:26 +0000625/**
626 * Add an icon to the desktop.
627 *
628 * \param icon The icon to be added.
adamdunkels0404ef12003-09-04 19:36:04 +0000629 *
630 * \param id The process ID of the process that owns the icon.
adamdunkelsb27d85a2003-09-01 22:23:26 +0000631 */
adamdunkels0404ef12003-09-04 19:36:04 +0000632#define CTK_ICON_ADD(icon, id) ctk_icon_add((struct ctk_widget *)icon, id)
633void ctk_icon_add(struct ctk_widget *icon, ek_id_t id);
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000634
635/* Functions for manipulating widgets. */
adamdunkelsb27d85a2003-09-01 22:23:26 +0000636
637/**
638 * Add a widget to a window.
639 *
640 * \param win The window to which the widget should be added.
641 * \param widg The widget to be added.
642 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000643#define CTK_WIDGET_ADD(win, widg) \
644 ctk_widget_add(win, (struct ctk_widget *)widg)
adamdunkelsa6557e42003-08-11 22:27:51 +0000645void CC_FASTCALL ctk_widget_add(struct ctk_window *window,
646 struct ctk_widget *widget);
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000647
adamdunkelsb27d85a2003-09-01 22:23:26 +0000648/**
649 * Set focus to a widget.
650 *
651 * \param win The widget's window.
652 * \param widg The widget
653 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000654#define CTK_WIDGET_FOCUS(win, widg) \
655 (win)->focused = (struct ctk_widget *)(widg)
adamdunkelsb27d85a2003-09-01 22:23:26 +0000656
657/**
658 * Add a widget to the redraw queue.
659 *
660 * \param widg The widget to be redrawn.
661 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000662#define CTK_WIDGET_REDRAW(widg) \
663 ctk_widget_redraw((struct ctk_widget *)widg)
664void ctk_widget_redraw(struct ctk_widget *w);
665
adamdunkelsb27d85a2003-09-01 22:23:26 +0000666/**
667 * Obtain the type of a widget.
668 *
669 * \param w The widget.
670 */
adamdunkels3a08a492003-04-11 20:16:02 +0000671#define CTK_WIDGET_TYPE(w) ((w)->type)
672
adamdunkelse8b21d02003-04-24 17:18:27 +0000673
adamdunkelsb27d85a2003-09-01 22:23:26 +0000674/**
675 * Sets the width of a widget.
676 *
677 * \param widget The widget.
678 * \param width The width of the widget, in characters.
679 */
adamdunkelse8b21d02003-04-24 17:18:27 +0000680#define CTK_WIDGET_SET_WIDTH(widget, width) do { \
681 ((struct ctk_widget *)(widget))->w = (width); } while(0)
682
adamdunkelsb27d85a2003-09-01 22:23:26 +0000683/**
684 * Retrieves the x position of a widget, relative to the window in
685 * which the widget is contained.
686 *
687 * \param w The widget.
688 * \return The x position of the widget.
689 */
adamdunkelse8b21d02003-04-24 17:18:27 +0000690#define CTK_WIDGET_XPOS(w) (((struct ctk_widget *)(w))->x)
adamdunkelsb27d85a2003-09-01 22:23:26 +0000691
692/**
693 * Sets the x position of a widget, relative to the window in
694 * which the widget is contained.
695 *
696 * \param w The widget.
697 * \param xpos The x position of the widget.
698 */
699#define CTK_WIDGET_SET_XPOS(w, xpos) \
700 ((struct ctk_widget *)(w))->x = (xpos)
701/**
702 * Retrieves the y position of a widget, relative to the window in
703 * which the widget is contained.
704 *
705 * \param w The widget.
706 * \return The y position of the widget.
707 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000708#define CTK_WIDGET_YPOS(w) (((struct ctk_widget *)(w))->y)
709
adamdunkelsb27d85a2003-09-01 22:23:26 +0000710/**
711 * Sets the y position of a widget, relative to the window in
712 * which the widget is contained.
713 *
714 * \param w The widget.
715 * \param ypos The y position of the widget.
716 */
717#define CTK_WIDGET_SET_YPOS(w, ypos) \
718 ((struct ctk_widget *)(w))->y = (ypos)
719
720/* XXX: should be removed.
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000721#define ctk_textentry_set_height(w, height) \
722 (w)->widget.textentry.h = (height)
adamdunkelsb27d85a2003-09-01 22:23:26 +0000723*/
724
725/** \def ctk_label_set_height(w, height)
726 * \brief Set the height of a label.
727 *
728 * \param w The CTK label widget.
729 * \param height The new height of the label.
730 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000731#define ctk_label_set_height(w, height) \
732 (w)->widget.label.h = (height)
adamdunkelsb27d85a2003-09-01 22:23:26 +0000733
734/**
735 * Set the text of a label.
736 *
737 * \param l The CTK label widget.
738 * \param t The new text of the label.
739 */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000740#define ctk_label_set_text(l, t) (l)->text = (t)
741
adamdunkelsb27d85a2003-09-01 22:23:26 +0000742/**
743 * Set the text of a button.
744 *
745 * \param b The CTK button widget.
746 * \param t The new text of the button.
747 */
adamdunkels1d5eb5e2003-03-28 12:10:39 +0000748#define ctk_button_set_text(b, t) (b)->text = (t)
749
adamdunkels58917a82003-04-18 00:18:38 +0000750#define ctk_bitmap_set_bitmap(b, m) (b)->bitmap = (m)
751
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000752#define CTK_BUTTON_NEW(widg, xpos, ypos, width, buttontext) \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000753 do { (widg)->window = NULL; \
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000754 (widg)->next = NULL; \
755 (widg)->type = CTK_WIDGET_BUTTON; \
756 (widg)->x = (xpos); \
757 (widg)->y = (ypos); \
758 (widg)->w = (width); \
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000759 (widg)->h = 1; \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000760 (widg)->text = (buttontext); \
761 } while(0)
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000762
763#define CTK_LABEL_NEW(widg, xpos, ypos, width, height, labeltext) \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000764 do { (widg)->window = NULL; \
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000765 (widg)->next = NULL; \
766 (widg)->type = CTK_WIDGET_LABEL; \
767 (widg)->x = (xpos); \
768 (widg)->y = (ypos); \
769 (widg)->w = (width); \
770 (widg)->h = (height); \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000771 (widg)->text = (labeltext); \
772 } while(0)
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000773
adamdunkels58917a82003-04-18 00:18:38 +0000774#define CTK_BITMAP_NEW(widg, xpos, ypos, width, height, bmap) \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000775 do { (widg)->window = NULL; \
adamdunkels58917a82003-04-18 00:18:38 +0000776 (widg)->next = NULL; \
777 (widg)->type = CTK_WIDGET_BITMAP; \
778 (widg)->x = (xpos); \
779 (widg)->y = (ypos); \
780 (widg)->w = (width); \
781 (widg)->h = (height); \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000782 (widg)->bitmap = (bmap); \
783 } while(0)
adamdunkels58917a82003-04-18 00:18:38 +0000784
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000785#define CTK_TEXTENTRY_NEW(widg, xxpos, yypos, width, height, textptr, textlen) \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000786 do { (widg)->window = NULL; \
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000787 (widg)->next = NULL; \
788 (widg)->type = CTK_WIDGET_TEXTENTRY; \
789 (widg)->x = (xxpos); \
790 (widg)->y = (yypos); \
791 (widg)->w = (width); \
792 (widg)->h = (height); \
793 (widg)->text = (textptr); \
794 (widg)->len = (textlen); \
795 (widg)->state = CTK_TEXTENTRY_NORMAL; \
796 (widg)->xpos = 0; \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000797 } while(0)
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000798
799
800#define CTK_HYPERLINK_NEW(widg, xpos, ypos, width, linktext, linkurl) \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000801 do { (widg)->window = NULL; \
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000802 (widg)->next = NULL; \
803 (widg)->type = CTK_WIDGET_HYPERLINK; \
804 (widg)->x = (xpos); \
805 (widg)->y = (ypos); \
806 (widg)->w = (width); \
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000807 (widg)->h = 1; \
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000808 (widg)->text = (linktext); \
adamdunkelsb27d85a2003-09-01 22:23:26 +0000809 (widg)->url = (linkurl); \
810 } while(0)
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000811
adamdunkelse2f4d2a2003-04-28 23:21:42 +0000812/* Desktop interface. */
adamdunkelseb9bf6c2003-06-30 20:45:50 +0000813void ctk_desktop_redraw(struct ctk_desktop *d);
814unsigned char ctk_desktop_width(struct ctk_desktop *d);
815unsigned char ctk_desktop_height(struct ctk_desktop *d);
adamdunkelse2f4d2a2003-04-28 23:21:42 +0000816
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000817/* Signals. */
818extern ek_signal_t ctk_signal_keypress,
adamdunkels3a08a492003-04-11 20:16:02 +0000819 ctk_signal_widget_activate,
820 ctk_signal_widget_select,
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000821 ctk_signal_timer,
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000822 ctk_signal_menu_activate,
adamdunkelsc4902862003-04-09 00:30:45 +0000823 ctk_signal_window_close,
824 ctk_signal_pointer_move,
adamdunkels3a08a492003-04-11 20:16:02 +0000825 ctk_signal_pointer_button;
826
adamdunkelse8b21d02003-04-24 17:18:27 +0000827#if CTK_CONF_SCREENSAVER
adamdunkels9795b2e2003-08-09 23:32:37 +0000828extern ek_signal_t ctk_signal_screensaver_stop,
829 ctk_signal_screensaver_start;
adamdunkelse2f4d2a2003-04-28 23:21:42 +0000830
831extern unsigned short ctk_screensaver_timeout;
adamdunkelsb27d85a2003-09-01 22:23:26 +0000832/**
833 * Set the screensaver timeout, in seconds.
834 *
835 * \param t The timeout in seconds.
836 */
adamdunkelse2f4d2a2003-04-28 23:21:42 +0000837#define CTK_SCREENSAVER_SET_TIMEOUT(t) ctk_screensaver_timeout = (t)
adamdunkelsb27d85a2003-09-01 22:23:26 +0000838/**
839 * Obtain the screensaver timeout, in seconds.
840 *
841 * \raturn The timeout in seconds.
842 */
adamdunkelse2f4d2a2003-04-28 23:21:42 +0000843#define CTK_SCREENSAVER_TIMEOUT() ctk_screensaver_timeout
adamdunkelse8b21d02003-04-24 17:18:27 +0000844#endif /* CTK_CONF_SCREENSAVER */
845
adamdunkels3a08a492003-04-11 20:16:02 +0000846/* These should no longer be used: */
847extern ek_signal_t ctk_signal_button_activate,
848 ctk_signal_button_hover,
849 ctk_signal_hyperlink_activate,
850 ctk_signal_hyperlink_hover;
adamdunkelse937ded2003-10-01 07:53:57 +0000851/** @} */
852
853/**
854 * \addtogroup ctkdraw
855 * @{
856 */
adamdunkels3a08a492003-04-11 20:16:02 +0000857
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000858/* Focus flags */
adamdunkelsb27d85a2003-09-01 22:23:26 +0000859/** Widget focus flag: no focus. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000860#define CTK_FOCUS_NONE 0
adamdunkelsb27d85a2003-09-01 22:23:26 +0000861/** Widget focus flag: widget has focus. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000862#define CTK_FOCUS_WIDGET 1
adamdunkelsb27d85a2003-09-01 22:23:26 +0000863/** Widget focus flag: widget's window is the foremost one. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000864#define CTK_FOCUS_WINDOW 2
adamdunkelsb27d85a2003-09-01 22:23:26 +0000865/** Widget focus flag: widget is in a dialog. */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000866#define CTK_FOCUS_DIALOG 4
867
adamdunkelse937ded2003-10-01 07:53:57 +0000868/** @} */
869/** @} */
adamdunkelsca9ddcb2003-03-19 14:13:31 +0000870#endif /* __CTK_H__ */