Contiki 2.6

ctk_arch-def.h

00001 /*
00002  * Copyright (c) 2007, Takahide Matsutsuka.
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above
00011  *    copyright notice, this list of conditions and the following
00012  *    disclaimer in the documentation and/or other materials provided
00013  *    with the distribution.
00014  * 3. The name of the author may not be used to endorse or promote
00015  *    products derived from this software without specific prior
00016  *    written permission.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
00019  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00020  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
00022  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00023  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00024  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00025  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00027  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00028  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029  *
00030  * $Id: ctk_arch-def.h,v 1.5 2007/12/14 23:49:14 oliverschmidt Exp $
00031  *
00032  */
00033 
00034 /*
00035  * \file
00036  *      ctk_arch-def.h
00037  *      Definitions of CTK for PC-6001 family, which consist of the following:
00038  *      - Configuraton for ctk main library.
00039  *      - Configuraton for ctk_arch library.
00040  *      This file is used in assembler file with precompilation, so
00041  *      NEVER include other than directives and comments.
00042  * \author
00043  *      Takahide Matsutsuka <markn@markn.org>
00044  */
00045 
00046 #ifndef __CTK_ARCH_DEF_H__
00047 #define __CTK_ARCH_DEF_H__
00048 
00049 /* characters */
00050 #if defined(ARCH_PC6001) || defined(ARCH_PC6001MK2)
00051 #define CH_VERTLINE                     0x16
00052 #define CH_HOLILINE                     0x17
00053 #define CH_ULCORNER                     0x18
00054 #define CH_URCORNER                     0x19
00055 #define CH_LLCORNER                     0x1a
00056 #define CH_LRCORNER                     0x1b
00057 #elif defined(ARCH_PC6001A)
00058 #define CH_VERTLINE                     '|'
00059 #define CH_HOLILINE                     '-'
00060 #define CH_ULCORNER                     '/'
00061 #define CH_URCORNER                     '\\'
00062 #define CH_LLCORNER                     '\\'
00063 #define CH_LRCORNER                     '/'
00064 #else
00065 #error invalid ARCH
00066 #endif
00067 #define CH_SPACE                        0x20
00068 
00069 /* screen properties */
00070 #if defined(ARCH_PC6001MK2)
00071 #define VRAM_ATTR                       0x4000
00072 #define VRAM_CHAR                       0x4400
00073 #define SCREEN_WIDTH                    40
00074 #define SCREEN_HEIGHT                   20
00075 #define COLOR_NORMAL                    0x0f
00076 #define COLOR_REVERSED                  0x70
00077 #elif (defined(ARCH_PC6001) || defined(ARCH_PC6001A)) && defined(MEMORY_16K)
00078 #define VRAM_ATTR                       0xc000
00079 #define VRAM_CHAR                       0xc200
00080 #define SCREEN_WIDTH                    32
00081 #define SCREEN_HEIGHT                   16
00082 #define COLOR_NORMAL                    0x20
00083 #define COLOR_REVERSED                  0x21
00084 #elif (defined(ARCH_PC6001) || defined(ARCH_PC6001A)) && (defined(MEMORY_32K) || defined(MEMORY_ROM))
00085 #define VRAM_ATTR                       0x8000
00086 #define VRAM_CHAR                       0x8200
00087 #define SCREEN_WIDTH                    32
00088 #define SCREEN_HEIGHT                   16
00089 #define COLOR_NORMAL                    0x20
00090 #define COLOR_REVERSED                  0x21
00091 #else
00092 #error Specify appropriate ARCH & MEMORY combination
00093 #endif /*  ARCH_PC6001MK2 */
00094 
00095 /* key code */
00096 #define CH_F1                           -16//0xf0
00097 #define CH_F2                           -15//0xf1
00098 #define CH_F3                           -14//0xf2
00099 #define CH_F4                           -13//0xf3
00100 #define CH_F5                           -12//0xf4
00101 #define CH_TAB                          0x09
00102 
00103 #define CH_CURS_UP                      0x1e
00104 #define CH_CURS_DOWN                    0x1f
00105 #define CH_CURS_LEFT                    0x1d
00106 #define CH_CURS_RIGHT                   0x1c
00107 #define CH_ENTER                        0x0d
00108 #define CH_ESC                          0x1b
00109 #define CH_STOP                         0x03
00110 #define CH_DEL                          0x08
00111 
00112 /* Contiki toolkit options */
00113 
00114 #if defined(CTK_CLIENT) || defined(CTK_SERVER)
00115 /* If network is available, turn all options off by the memory reason */
00116 #define CTK_CONF_ICONS                  0
00117 #define CTK_CONF_ICON_TEXTMAPS          0
00118 #define CTK_CONF_WINDOWS                1
00119 #define CTK_CONF_WINDOWCLOSE            0
00120 #define CTK_CONF_WINDOWMOVE             0
00121 #define CTK_CONF_MENUS                  0
00122 #define CTK_CONF_HYPERLINK              0
00123 #elif defined(CTK_NOICON)
00124 /* In the case of loader arch, we omit the icons by the memory reason */
00125 #define CTK_CONF_ICONS                  0
00126 #define CTK_CONF_ICON_TEXTMAPS          0
00127 #define CTK_CONF_WINDOWS                1
00128 #define CTK_CONF_WINDOWCLOSE            1
00129 #define CTK_CONF_WINDOWMOVE             1
00130 #define CTK_CONF_MENUS                  1
00131 #define CTK_CONF_HYPERLINK              1
00132 #else /* CTK_MINIMUM */
00133 /* Toggles support for desktop icons. */
00134 #define CTK_CONF_ICONS                  1
00135 /* Define if text icon is used. */
00136 #define CTK_CONF_ICON_TEXTMAPS          1
00137 /* Toggles support for windows. */
00138 #define CTK_CONF_WINDOWS                1
00139 /* Toggles support for closable windows. */
00140 #define CTK_CONF_WINDOWCLOSE            1
00141 /* Toggles support for movable windows. */
00142 #define CTK_CONF_WINDOWMOVE             1
00143 /* Toggles support for menus. */
00144 #define CTK_CONF_MENUS                  1
00145 /* Defines if hyperlink is supported. */
00146 #define CTK_CONF_HYPERLINK              1
00147 #endif /* CTK_MINIMUM */
00148 
00149 /* Define if bitmap icon is used. */
00150 #define CTK_CONF_ICON_BITMAPS           0
00151 /* Defines the default width of a menu. */
00152 #define CTK_CONF_MENUWIDTH              16
00153 /* Defines if screen saver is supported. */
00154 #define CTK_CONF_SCREENSAVER            0
00155 /* Defines if mouse is supported. */
00156 #define CTK_CONF_MOUSE_SUPPORT          0
00157 
00158 /* The maximum number of menu items in each menu. */
00159 #define CTK_CONF_MAXMENUITEMS           4
00160 
00161 /* Key used to switch the frontmost window.  */
00162 #define CTK_CONF_WINDOWSWITCH_KEY       CH_F3
00163 /* Key used to move down a widget.  */
00164 #define CTK_CONF_WIDGETDOWN_KEY         CH_TAB
00165 /* Key used to move up a widget.  */
00166 #define CTK_CONF_WIDGETUP_KEY           CH_F5
00167 /* Defines which key that is to be used for activating the menus */
00168 #define CTK_CONF_MENU_KEY               CH_F1
00169 
00170 #ifdef LIBCONIO_CONF_EXPORT
00171 #define LIBCONIO_EXPORT LIBCONIO_CONF_EXPORT
00172 #else /* LIBCONIO_CONF_EXPORT */
00173 #define LIBCONIO_EXPORT 0
00174 #endif /* LIBCONIO_CONF_EXPORT */
00175 
00176 /* Imported symbols from ctk.h */
00177 
00178 #define _CTK_FOCUS_NONE         0
00179 #define _CTK_FOCUS_WIDGET       1
00180 #define _CTK_FOCUS_WINDOW       2
00181 #define _CTK_FOCUS_DIALOG       4
00182 
00183 #define _CTK_WIDGET_SEPARATOR   1
00184 #define _CTK_WIDGET_LABEL       2
00185 #define _CTK_WIDGET_BUTTON      3
00186 #define _CTK_WIDGET_HYPERLINK   4
00187 #define _CTK_WIDGET_TEXTENTRY   5
00188 #define _CTK_WIDGET_BITMAP      6
00189 #define _CTK_WIDGET_ICON        7
00190 
00191 #define _CTK_TEXTENTRY_NORMAL   0
00192 #define _CTK_TEXTENTRY_EDIT     1
00193 
00194 #endif /* __CTK_ARCH_DEF_H__ */