/* Copyright 1992 NEC Corporation, Tokyo, Japan.
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without
 * fee, provided that the above copyright notice appear in all copies
 * and that both that copyright notice and this permission notice
 * appear in supporting documentation, and that the name of NEC
 * Corporation not be used in advertising or publicity pertaining to
 * distribution of the software without specific, written prior
 * permission.  NEC Corporation makes no representations about the
 * suitability of this software for any purpose.  It is provided "as
 * is" without express or implied warranty.
 *
 * NEC CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN 
 * NO EVENT SHALL NEC CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 
 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 
 * OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 
 * PERFORMANCE OF THIS SOFTWARE. 
 */


extern int AlphaMode(), HenkanNyuryokuMode();
#ifndef NO_EXTEND_MENU
extern int HexMode(), BushuMode();
#endif
extern int KigoIchiran(), UiUtilMode();
extern int YomiBaseHiraKataToggle(), YomiBaseZenHanToggle();
extern int YomiBaseKanaEisuToggle(), YomiBaseKakuteiHenkanToggle();
extern int YomiBaseRotateForw(), YomiBaseRotateBack();
extern int DoFuncSequence(), UseOtherKeymap(), YomiModeBackup();
extern int dicTouroku pro((uiContext)), dicSakujo pro((uiContext));
#ifndef NO_EXTEND_MENU
extern int kigoRussia(), kigoGreek(), kigoKeisen();
extern int dicMount(), serverChange(), serverFin();
extern int chikujiInit();
#endif

#define NONE CANNA_FN_Undefined

static struct funccfunc empty_funcs[] = {
  {CANNA_FN_SelfInsert		,EmptySelfInsert	},
  {CANNA_FN_FunctionalInsert	,EmptyYomiInsert	},
  {CANNA_FN_QuotedInsert	,EmptyQuotedInsert	},
  {CANNA_FN_AlphaMode		,AlphaMode		},
  {CANNA_FN_HenkanNyuryokuMode	,HenkanNyuryokuMode	},
  {CANNA_FN_KigouMode		,KigoIchiran		},
  {CANNA_FN_DeletePrevious	,EmptyDeletePrevious	},
  {CANNA_FN_Kakutei		,EmptyKakutei		},
  {CANNA_FN_Quit		,EmptyQuit		},
  {CANNA_FN_ExtendMode		,UiUtilMode		},
  {CANNA_FN_BaseHiragana	,EmptyBaseHira		},
  {CANNA_FN_BaseKatakana	,EmptyBaseKata		},
  {CANNA_FN_BaseKana		,EmptyBaseKana		},
  {CANNA_FN_BaseEisu		,EmptyBaseEisu		},
  {CANNA_FN_BaseZenkaku		,EmptyBaseZen		},
  {CANNA_FN_BaseHankaku		,EmptyBaseHan		},
  {CANNA_FN_BaseKakutei		,EmptyBaseKakutei	},
  {CANNA_FN_BaseHenkan		,EmptyBaseHenkan	},
  {CANNA_FN_BaseHiraKataToggle	,YomiBaseHiraKataToggle	},
  {CANNA_FN_BaseZenHanToggle	,YomiBaseZenHanToggle	},
  {CANNA_FN_BaseKanaEisuToggle	,YomiBaseKanaEisuToggle	},
  {CANNA_FN_BaseKakuteiHenkanToggle ,YomiBaseKakuteiHenkanToggle	},
  {CANNA_FN_BaseRotateForward	,YomiBaseRotateForw	},
  {CANNA_FN_BaseRotateBackward	,YomiBaseRotateBack	},
  {CANNA_FN_FuncSequence	,DoFuncSequence		},
  {CANNA_FN_TemporalMode	,YomiModeBackup		},

  {CANNA_FN_Nop			,AlphaNop		},
  {CANNA_FN_UseOtherKeymap	,UseOtherKeymap		},
  {CANNA_FN_UserMode		,(int (*) pro((struct _uiContext *)))
                                 ProcExtraFunc		},

#ifndef NO_EXTEND_MENU
  {CANNA_FN_DefineDicMode	,dicTouroku		},
  {CANNA_FN_DeleteDicMode	,dicSakujo		},
  {CANNA_FN_HexMode		,HexMode		},
  {CANNA_FN_BushuMode		,BushuMode		},
  {CANNA_FN_RussianMode		,kigoRussia		},
  {CANNA_FN_GreekMode		,kigoGreek		},
  {CANNA_FN_LineMode		,kigoKeisen		},
  {CANNA_FN_SyncDic		,dicSync		},
  {CANNA_FN_DicMountMode	,dicMount		},
  {CANNA_FN_ChangeServerMode	,serverChange		},
  {CANNA_FN_DisconnectServer	,serverFin		},
  {CANNA_FN_ShowServer		,showServer		},
  {CANNA_FN_ShowGakushu		,showGakushu		},
  {CANNA_FN_ShowVersion		,showVersion		},
  {CANNA_FN_ShowPhonogramFile	,showRomkanaFile	},
  {CANNA_FN_ShowCannaFile	,showInitFile		},
  {CANNA_FN_EnterChikujiMode	,chikujiInit		},
  {CANNA_FN_EnterRenbunMode	,renbunInit		},
#endif
  {DEFAULTBEHAVIOR		,EmptySelfInsert	},
  {0				,0			},
};

BYTE empty_kmap[256] =
{               
/* C-@ */       CANNA_FN_SelfInsert,
/* C-a */       CANNA_FN_SelfInsert,
/* C-b */       CANNA_FN_SelfInsert,
/* C-c */       CANNA_FN_SelfInsert,
/* C-d */       CANNA_FN_SelfInsert,
/* C-e */       CANNA_FN_SelfInsert,
/* C-f */       CANNA_FN_SelfInsert,
/* C-g */       CANNA_FN_Quit,
/* C-h */       CANNA_FN_DeletePrevious,
/* C-i */       CANNA_FN_SelfInsert,
/* C-j */       CANNA_FN_Kakutei,
/* C-k */       CANNA_FN_SelfInsert,
/* C-l */       CANNA_FN_SelfInsert,
/* C-m */       CANNA_FN_Kakutei,
/* C-n */       CANNA_FN_SelfInsert,
/* C-o */       CANNA_FN_AlphaMode,
/* C-p */       CANNA_FN_SelfInsert,
/* C-q */       CANNA_FN_QuotedInsert,
/* C-r */       CANNA_FN_SelfInsert,
/* C-s */       CANNA_FN_SelfInsert,
/* C-t */       CANNA_FN_SelfInsert,
/* C-u */       CANNA_FN_SelfInsert,
/* C-v */       CANNA_FN_SelfInsert,
/* C-w */       CANNA_FN_SelfInsert,
/* C-x */       CANNA_FN_SelfInsert,
/* C-y */       CANNA_FN_SelfInsert,
/* C-z */       CANNA_FN_SelfInsert,
/* C-[ */       CANNA_FN_SelfInsert,
/* C-\ */       CANNA_FN_SelfInsert,
/* C-] */       CANNA_FN_SelfInsert,
/* C-^ */       CANNA_FN_SelfInsert,
/* C-_ */       CANNA_FN_SelfInsert,
/* space */     CANNA_FN_SelfInsert,
/* ! */         CANNA_FN_FunctionalInsert,
/* " */         CANNA_FN_FunctionalInsert,
/* # */         CANNA_FN_FunctionalInsert,
/* $ */         CANNA_FN_FunctionalInsert,
/* % */         CANNA_FN_FunctionalInsert,
/* & */         CANNA_FN_FunctionalInsert,
/* ' */         CANNA_FN_FunctionalInsert,
/* ( */         CANNA_FN_FunctionalInsert,
/* ) */         CANNA_FN_FunctionalInsert,
/* * */         CANNA_FN_FunctionalInsert,
/* + */         CANNA_FN_FunctionalInsert,
/* , */         CANNA_FN_FunctionalInsert,
/* - */         CANNA_FN_FunctionalInsert,
/* . */         CANNA_FN_FunctionalInsert,
/* / */         CANNA_FN_FunctionalInsert,
/* 0 */         CANNA_FN_FunctionalInsert,
/* 1 */         CANNA_FN_FunctionalInsert,
/* 2 */         CANNA_FN_FunctionalInsert,
/* 3 */         CANNA_FN_FunctionalInsert,
/* 4 */         CANNA_FN_FunctionalInsert,
/* 5 */         CANNA_FN_FunctionalInsert,
/* 6 */         CANNA_FN_FunctionalInsert,
/* 7 */         CANNA_FN_FunctionalInsert,
/* 8 */         CANNA_FN_FunctionalInsert,
/* 9 */         CANNA_FN_FunctionalInsert,
/* : */         CANNA_FN_FunctionalInsert,
/* ; */         CANNA_FN_FunctionalInsert,
/* < */         CANNA_FN_FunctionalInsert,
/* = */         CANNA_FN_FunctionalInsert,
/* > */         CANNA_FN_FunctionalInsert,
/* ? */         CANNA_FN_FunctionalInsert,
/* @ */         CANNA_FN_FunctionalInsert,
/* A */         CANNA_FN_FunctionalInsert,
/* B */         CANNA_FN_FunctionalInsert,
/* C */         CANNA_FN_FunctionalInsert,
/* D */         CANNA_FN_FunctionalInsert,
/* E */         CANNA_FN_FunctionalInsert,
/* F */         CANNA_FN_FunctionalInsert,
/* G */         CANNA_FN_FunctionalInsert,
/* H */         CANNA_FN_FunctionalInsert,
/* I */         CANNA_FN_FunctionalInsert,
/* J */         CANNA_FN_FunctionalInsert,
/* K */         CANNA_FN_FunctionalInsert,
/* L */         CANNA_FN_FunctionalInsert,
/* M */         CANNA_FN_FunctionalInsert,
/* N */         CANNA_FN_FunctionalInsert,
/* O */         CANNA_FN_FunctionalInsert,
/* P */         CANNA_FN_FunctionalInsert,
/* Q */         CANNA_FN_FunctionalInsert,
/* R */         CANNA_FN_FunctionalInsert,
/* S */         CANNA_FN_FunctionalInsert,
/* T */         CANNA_FN_FunctionalInsert,
/* U */         CANNA_FN_FunctionalInsert,
/* V */         CANNA_FN_FunctionalInsert,
/* W */         CANNA_FN_FunctionalInsert,
/* X */         CANNA_FN_FunctionalInsert,
/* Y */         CANNA_FN_FunctionalInsert,
/* Z */         CANNA_FN_FunctionalInsert,
/* [ */         CANNA_FN_FunctionalInsert,
/* \ */         CANNA_FN_FunctionalInsert,
/* ] */         CANNA_FN_FunctionalInsert,
/* ^ */         CANNA_FN_FunctionalInsert,
/* _ */         CANNA_FN_FunctionalInsert,
/* ` */         CANNA_FN_FunctionalInsert,
/* a */         CANNA_FN_FunctionalInsert,
/* b */         CANNA_FN_FunctionalInsert,
/* c */         CANNA_FN_FunctionalInsert,
/* d */         CANNA_FN_FunctionalInsert,
/* e */         CANNA_FN_FunctionalInsert,
/* f */         CANNA_FN_FunctionalInsert,
/* g */         CANNA_FN_FunctionalInsert,
/* h */         CANNA_FN_FunctionalInsert,
/* i */         CANNA_FN_FunctionalInsert,
/* j */         CANNA_FN_FunctionalInsert,
/* k */         CANNA_FN_FunctionalInsert,
/* l */         CANNA_FN_FunctionalInsert,
/* m */         CANNA_FN_FunctionalInsert,
/* n */         CANNA_FN_FunctionalInsert,
/* o */         CANNA_FN_FunctionalInsert,
/* p */         CANNA_FN_FunctionalInsert,
/* q */         CANNA_FN_FunctionalInsert,
/* r */         CANNA_FN_FunctionalInsert,
/* s */         CANNA_FN_FunctionalInsert,
/* t */         CANNA_FN_FunctionalInsert,
/* u */         CANNA_FN_FunctionalInsert,
/* v */         CANNA_FN_FunctionalInsert,
/* w */         CANNA_FN_FunctionalInsert,
/* x */         CANNA_FN_FunctionalInsert,
/* y */         CANNA_FN_FunctionalInsert,
/* z */         CANNA_FN_FunctionalInsert,
/* { */         CANNA_FN_FunctionalInsert,
/* | */         CANNA_FN_FunctionalInsert,
/* } */         CANNA_FN_FunctionalInsert,
/* ~ */         CANNA_FN_FunctionalInsert,
/* DEL */       CANNA_FN_SelfInsert,
/* Nfer */      CANNA_FN_Kakutei,
/* Xfer */      CANNA_FN_AlphaMode,
/* Up */        NONE,
/* Left */      NONE,
/* Right */     NONE,
/* Down */      NONE,
/* Insert */    CANNA_FN_KigouMode,
/* Rollup */    NONE,
/* Rolldown */  NONE,
/* Home */      CANNA_FN_ExtendMode,
/* Help */      CANNA_FN_ExtendMode,
/* KeyPad */    NONE,
/* 8c */        NONE,
/* 8d */        NONE,
/* 8e */        NONE,
/* 8f */        NONE,
/* S-nfer */    NONE,
/* S-xfer */    CANNA_FN_AlphaMode,
/* S-up */      NONE,
/* S-left */    NONE,
/* S-right */   NONE,
/* S-down */    NONE,
/* C-nfer */    NONE,
/* C-xfer */    CANNA_FN_AlphaMode,
/* C-up */      NONE,
/* C-left */    NONE,
/* C-right */   NONE,
/* C-down */    NONE,
/* 9c */        NONE,
/* 9d */        NONE,
/* 9e */        NONE,
/* 9f */        NONE,
/* KANASPACE */ NONE,
/* ¡£ */        CANNA_FN_FunctionalInsert,
/* ¡Ö */        CANNA_FN_FunctionalInsert,
/* ¡× */        CANNA_FN_FunctionalInsert,
/* ¡¢ */        CANNA_FN_FunctionalInsert,
/* ¡¦ */        CANNA_FN_FunctionalInsert,
/* ¥ò */        CANNA_FN_FunctionalInsert,
/* ¥¡ */        CANNA_FN_FunctionalInsert,
/* ¥£ */        CANNA_FN_FunctionalInsert,
/* ¥¥ */        CANNA_FN_FunctionalInsert,
/* ¥§ */        CANNA_FN_FunctionalInsert,
/* ¥© */        CANNA_FN_FunctionalInsert,
/* ¥ã */        CANNA_FN_FunctionalInsert,
/* ¥å */        CANNA_FN_FunctionalInsert,
/* ¥ç */        CANNA_FN_FunctionalInsert,
/* ¥Ã */        CANNA_FN_FunctionalInsert,
/* ¡¼ */        CANNA_FN_FunctionalInsert,
/* ¥¢ */        CANNA_FN_FunctionalInsert,
/* ¥¤ */        CANNA_FN_FunctionalInsert,
/* ¥¦ */        CANNA_FN_FunctionalInsert,
/* ¥¨ */        CANNA_FN_FunctionalInsert,
/* ¥ª */        CANNA_FN_FunctionalInsert,
/* ¥« */        CANNA_FN_FunctionalInsert,
/* ¥­ */        CANNA_FN_FunctionalInsert,
/* ¥¯ */        CANNA_FN_FunctionalInsert,
/* ¥± */        CANNA_FN_FunctionalInsert,
/* ¥³ */        CANNA_FN_FunctionalInsert,
/* ¥µ */        CANNA_FN_FunctionalInsert,
/* ¥· */        CANNA_FN_FunctionalInsert,
/* ¥¹ */        CANNA_FN_FunctionalInsert,
/* ¥» */        CANNA_FN_FunctionalInsert,
/* ¥½ */        CANNA_FN_FunctionalInsert,
/* ¥¿ */        CANNA_FN_FunctionalInsert,
/* ¥Á */        CANNA_FN_FunctionalInsert,
/* ¥Ä */        CANNA_FN_FunctionalInsert,
/* ¥Æ */        CANNA_FN_FunctionalInsert,
/* ¥È */        CANNA_FN_FunctionalInsert,
/* ¥Ê */        CANNA_FN_FunctionalInsert,
/* ¥Ë */        CANNA_FN_FunctionalInsert,
/* ¥Ì */        CANNA_FN_FunctionalInsert,
/* ¥Í */        CANNA_FN_FunctionalInsert,
/* ¥Î */        CANNA_FN_FunctionalInsert,
/* ¥Ï */        CANNA_FN_FunctionalInsert,
/* ¥Ò */        CANNA_FN_FunctionalInsert,
/* ¥Õ */        CANNA_FN_FunctionalInsert,
/* ¥Ø */        CANNA_FN_FunctionalInsert,
/* ¥Û */        CANNA_FN_FunctionalInsert,
/* ¥Þ */        CANNA_FN_FunctionalInsert,
/* ¥ß */        CANNA_FN_FunctionalInsert,
/* ¥à */        CANNA_FN_FunctionalInsert,
/* ¥á */        CANNA_FN_FunctionalInsert,
/* ¥â */        CANNA_FN_FunctionalInsert,
/* ¥ä */        CANNA_FN_FunctionalInsert,
/* ¥æ */        CANNA_FN_FunctionalInsert,
/* ¥è */        CANNA_FN_FunctionalInsert,
/* ¥é */        CANNA_FN_FunctionalInsert,
/* ¥ê */        CANNA_FN_FunctionalInsert,
/* ¥ë */        CANNA_FN_FunctionalInsert,
/* ¥ì */        CANNA_FN_FunctionalInsert,
/* ¥í */        CANNA_FN_FunctionalInsert,
/* ¥ï */        CANNA_FN_FunctionalInsert,
/* ¥ó */        CANNA_FN_FunctionalInsert,
/* ¡« */        CANNA_FN_FunctionalInsert,
/* ¡¬ */        CANNA_FN_FunctionalInsert,
/* F1 */        NONE,
/* F2 */        NONE,
/* F3 */        NONE,
/* F4 */        NONE,
/* F5 */        NONE,
/* F6 */        NONE,
/* F7 */        NONE,
/* F8 */        NONE,
/* F9 */        NONE,
/* F10 */       NONE,
/* ea */        NONE,
/* eb */        NONE,
/* ec */        NONE,
/* ed */        NONE,
/* ee */        NONE,
/* ef */        NONE,
/* PF1 */       NONE,
/* PF2 */       NONE,
/* PF3 */       NONE,
/* PF4 */       NONE,
/* PF5 */       NONE,
/* PF6 */       NONE,
/* PF7 */       NONE,
/* PF8 */       NONE,
/* PF9 */       NONE,
/* PF10 */      NONE,
/* fa */        NONE,
/* fb */        NONE,
/* fc */        NONE,
/* fd */        NONE,
/* fe */        NONE,
/* ff */        NONE,
};

KanjiModeRec empty_mode = {
  searchfunc,
  empty_kmap,
  CANNA_KANJIMODE_TABLE_SHARED | CANNA_KANJIMODE_EMPTY_MODE,
  empty_funcs,
};
