static int vBushuMode(uiContext d, int major_mode) { forichiranContext fc; ichiranContext ic; unsigned inhibit = 0; int retval = 0; d->status = 0; if((retval = getForIchiranContext(d)) == NG) { killmenu(d); return(GLineNGReturn(d)); } fc = (forichiranContext)d->modec; /* selectOne ¤ò¸Æ¤Ö¤¿¤á¤Î½àÈ÷ */ fc->allkouho = bushu_char; fc->curIkouho = 0; if (!cannaconf.HexkeySelect) inhibit |= ((unsigned char)NUMBERING | (unsigned char)CHARINSERT); else inhibit |= (unsigned char)CHARINSERT; if((retval = selectOne(d, fc->allkouho, &fc->curIkouho, BUSHU_SZ, BANGOMAX, inhibit, 0, WITH_LIST_CALLBACK, NO_CALLBACK, vBushuExitCatch, bushuQuitCatch, uiUtilIchiranTooSmall)) == NG) { killmenu(d); return(GLineNGReturnFI(d)); } ic = (ichiranContext)d->modec; ic->majorMode = major_mode; ic->minorMode = CANNA_MODE_BushuMode; currentModeInfo(d); *(ic->curIkouho) = d->curbushu; /* ¸õÊä°ìÍ÷¹Ô¤¬¶¹¤¯¤Æ¸õÊä°ìÍ÷¤¬½Ð¤»¤Ê¤¤ */ if(ic->tooSmall) { d->status = AUX_CALLBACK; killmenu(d); return(retval); } if ( !(ic->flags & ICHIRAN_ALLOW_CALLBACK) ) { makeGlineStatus(d); } /* d->status = ICHIRAN_EVERYTIME; */ return(retval); }
static int dicSync(uiContext d) { int retval = 0; char s[512]; extern int defaultContext; yomiContext yc = (yomiContext)d->modec; if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) { return NothingChangedWithBeep(d); } d->status = 0; killmenu(d); retval = RkwSync(defaultContext, ""); sprintf(s, "\274\255\275\361\244\316 Sync \275\350\315\375%s", retval < 0 ? "\244\313\274\272\307\324\244\267\244\336\244\267" "\244\277" : "\244\362\271\324\244\244\244\336\244\267\244\277"); /* ¼½ñ¤Î Sync ½èÍý%s", retval < 0 ? "¤Ë¼ºÇÔ¤·¤Þ¤·¤¿" : "¤ò¹Ô¤¤¤Þ¤·¤¿ */ makeGLineMessageFromString(d, s); currentModeInfo(d); return 0; }
static int showRomkanaFile(uiContext d) { int retval = 0; char s[512]; extern char *RomkanaTable; yomiContext yc = (yomiContext)d->modec; if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) { return NothingChangedWithBeep(d); } d->status = 0; killmenu(d); if (RomkanaTable && romajidic) { sprintf(s, "\245\355\241\274\245\336\273\372\244\253\244\312\312\321" "\264\271\245\306\241\274\245\326\245\353\244\317 %s \244\362\273\310" "\315\321\244\267\244\306\244\244\244\336\244\271", RomkanaTable); /* ¥í¡¼¥Þ»ú¤«¤ÊÊÑ´¹¥Æ¡¼¥Ö¥ë¤Ï %s ¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹ */ makeGLineMessageFromString(d, s); } else { sprintf(s, "\245\355\241\274\245\336\273\372\244\253\244\312\312\321" "\264\271\245\306\241\274\245\326\245\353\244\317\273\310\315\321" "\244\265\244\354\244\306\244\244\244\336\244\273\244\363"); /* ¥í¡¼¥Þ»ú¤«¤ÊÊÑ´¹¥Æ¡¼¥Ö¥ë¤Ï»ÈÍѤµ¤ì¤Æ¤¤¤Þ¤»¤ó */ makeGLineMessageFromString(d, s); } currentModeInfo(d); return (retval); }
static int showInitFile(uiContext d) { int retval = 0; char s[512]; extern char *CANNA_initfilename; yomiContext yc = (yomiContext)d->modec; if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) { return NothingChangedWithBeep(d); } d->status = 0; killmenu(d); if (CANNA_initfilename && strlen(CANNA_initfilename)) { sprintf(s, "\245\253\245\271\245\277\245\336\245\244\245\272\245\325" "\245\241\245\244\245\353\244\317 %s \244\362\273\310\315\321\244\267" "\244\306\244\244\244\336\244\271", CANNA_initfilename); /* ¥«¥¹¥¿¥Þ¥¤¥º¥Õ¥¡¥¤¥ë¤Ï %s ¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹ */ makeGLineMessageFromString(d, s); } else { sprintf(s, "\245\253\245\271\245\277\245\336\245\244\245\272\245\325" "\245\241\245\244\245\353\244\317\300\337\304\352\244\265\244\354" "\244\306\244\244\244\336\244\273\244\363"); /* ¥«¥¹¥¿¥Þ¥¤¥º¥Õ¥¡¥¤¥ë¤ÏÀßÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó */ makeGLineMessageFromString(d, s); } currentModeInfo(d); return (retval); }
static int showGakushu(uiContext d) { int retval = 0; yomiContext yc = (yomiContext)d->modec; if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) { return NothingChangedWithBeep(d); } d->status = 0; killmenu(d); if (cannaconf.Gakushu == 1) { makeGLineMessageFromString(d, "\263\330\275\254\244\254\243\317\243\316" "\244\316\276\365\302\326\244\307\244\271"); /* ³Ø½¬¤¬£Ï£Î¤Î¾õÂ֤Ǥ¹ */ } else { makeGLineMessageFromString(d, "\263\330\275\254\244\254\243\317\243\306" "\243\306\244\316\276\365\302\326\244\307\244\271"); /* ³Ø½¬¤¬£Ï£Æ£Æ¤Î¾õÂ֤Ǥ¹ */ } currentModeInfo(d); return (retval); }
static int showServer(uiContext d) { #ifndef STANDALONE /* This is not used in Windows environment 1996.7.30 kon */ int retval = 0; char s[512]; extern defaultContext; yomiContext yc = (yomiContext)d->modec; if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) { return NothingChangedWithBeep(d); } d->status = 0; killmenu(d); if(defaultContext == -1) { sprintf(s, "\244\253\244\312\264\301\273\372\312\321\264\271\245\265" "\241\274\245\320\244\310\244\316\300\334\302\263\244\254\300\332" "\244\354\244\306\244\244\244\336\244\271"); /* ¤«¤Ê´Á»úÊÑ´¹¥µ¡¼¥Ð¤È¤ÎÀܳ¤¬ÀÚ¤ì¤Æ¤¤¤Þ¤¹ */ } else { sprintf(s, "%s \244\316\244\253\244\312\264\301\273\372\312\321\264\271" "\245\265\241\274\245\320\244\313\300\334\302\263\244\267\244\306" "\244\244\244\336\244\271", RkwGetServerName()); /* ¤Î¤«¤Ê´Á»úÊÑ´¹¥µ¡¼¥Ð¤ËÀܳ¤·¤Æ¤¤¤Þ¤¹ */ } makeGLineMessageFromString(d, s); currentModeInfo(d); return (retval); #else return (0); #endif /* STANDALONE */ }
static int renbunInit(uiContext d) { yomiContext yc = (yomiContext)d->modec; if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) { return NothingChangedWithBeep(d); } d->status = 0; killmenu(d); if (ToggleChikuji(d, 0) == -1) { jrKanjiError = "\317\242\312\270\300\341\312\321\264\271\244\313\300\332" "\302\330\244\250\244\353\244\263\244\310\244\254\244\307\244\255" "\244\336\244\273\244\363"; /* ϢʸÀáÊÑ´¹¤ËÀÚÂؤ¨¤ë¤³¤È¤¬¤Ç¤¤Þ¤»¤ó */ makeGLineMessageFromString(d, jrKanjiError); currentModeInfo(d); return(-1); } else { makeGLineMessageFromString(d, "\317\242\312\270\300\341\312\321\264\271" "\244\313\300\332\302\330\244\250\244\336\244\267\244\277"); /* ϢʸÀáÊÑ´¹¤ËÀÚÂؤ¨¤Þ¤·¤¿ */ currentModeInfo(d); return 0; } }
int BushuMode(uiContext d) { yomiContext yc = (yomiContext)d->modec; if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) { killmenu(d); return NothingChangedWithBeep(d); } return(vBushuMode(d, CANNA_MODE_BushuMode)); }
static int exitHex(uiContext d, int retval, mode_context env) { killmenu(d); if (cvtAsHex(d, d->buffer_return, d->buffer_return, d->nbytes)) { GlineClear(d); popCallback(d); retval = YomiExit(d, 1); currentModeInfo(d); return retval; } else { return quitHex(d, 0, env); } }
int chikujiInit(uiContext d) { int chikuji_f; yomiContext yc = (yomiContext)d->modec; if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) { return NothingChangedWithBeep(d); } d->status = 0; killmenu(d); chikuji_f = doesSupportChikuji(); if (ToggleChikuji(d, 1) == -1) { if(!chikuji_f) jrKanjiError = "\245\265\241\274\245\320\244\254\303\340\274\241\274\253" "\306\260\312\321\264\271\244\362\245\265\245\335\241\274\245\310" "\244\267\244\306\244\244\244\336\244\273\244\363"; /* ¥µ¡¼¥Ð¤¬Ã༡¼«Æ°ÊÑ´¹¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó */ else jrKanjiError = "\303\340\274\241\274\253\306\260\312\321\264\271\244\313" "\300\332\302\330\244\250\244\353\244\263\244\310\244\254\244\307" "\244\255\244\336\244\273\244\363"; /* Ã༡¼«Æ°ÊÑ´¹¤ËÀÚÂؤ¨¤ë¤³¤È¤¬¤Ç¤¤Þ¤»¤ó */ makeGLineMessageFromString(d, jrKanjiError); currentModeInfo(d); return(-1); } else { if(!chikuji_f) makeGLineMessageFromString(d, "\245\265\241\274\245\320\244\254\303\340" "\274\241\274\253\306\260\312\321\264\271\244\362\245\265\245\335" "\241\274\245\310\244\267\244\306\244\244\244\336\244\273\244\363"); /* ¥µ¡¼¥Ð¤¬Ã༡¼«Æ°ÊÑ´¹¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó */ else makeGLineMessageFromString(d, "\303\340\274\241\274\253\306\260\312\321" "\264\271\244\313\300\332\302\330\244\250\244\336\244\267\244\277"); /* Ã༡¼«Æ°ÊÑ´¹¤ËÀÚÂؤ¨¤Þ¤·¤¿ */ currentModeInfo(d); return 0; } }
static int showVersion(uiContext d) { int retval = 0; char s[512]; yomiContext yc = (yomiContext)d->modec; if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) { return NothingChangedWithBeep(d); } d->status = 0; killmenu(d); sprintf(s, "\306\374\313\334\270\354\306\376\316\317\245\267\245\271\245\306" "\245\340\241\330\244\253\244\363\244\312\241\331Version %d.%d", cannaconf.CannaVersion / 1000, cannaconf.CannaVersion % 1000); /* ÆüËܸìÆþÎÏ¥·¥¹¥Æ¥à¡Ø¤«¤ó¤Ê¡Ù */ strcat(s, CANNA_PATCH_LEVEL); makeGLineMessageFromString(d, s); currentModeInfo(d); return (retval); }
static int bushuExitCatch(uiContext d, int retval, mode_context env) { yomiContext yc; popCallback(d); /* °ìÍ÷¤ò¥Ý¥Ã¥× */ if (((forichiranContext)env)->allkouho != bushu_char) { /* bushu_char ¤Ï static ¤ÎÇÛÎó¤À¤«¤é free ¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ ¤³¤¦¸À¤¦¤Î¤Ã¤Æ¤Ê¤ó¤«±ø¤¤¤Ê¤¢ */ freeGetIchiranList(((forichiranContext)env)->allkouho); } popForIchiranMode(d); popCallback(d); yc = (yomiContext)d->modec; if (yc->savedFlags & CANNA_YOMI_MODE_SAVED) { restoreFlags(yc); } retval = YomiExit(d, retval); killmenu(d); currentModeInfo(d); return retval; }
static int bushuHenkan(uiContext d, int flag, int ext, int cur, int (*quitfunc )(uiContext, int, mode_context )) { forichiranContext fc; ichiranContext ic; unsigned inhibit = 0; WCHAR_T *yomi, **allBushuCands; RkStat st; int nelem, currentkouho, nbunsetsu, length, retval = 0; extern int defaultBushuContext; if(flag) { yomi = (WCHAR_T *)bushu_key[cur]; length = WStrlen(yomi); d->curbushu = (short)cur; } else { d->nbytes = RomajiFlushYomi(d, d->buffer_return, d->n_buffer); yomi = d->buffer_return; length = d->nbytes; } if((nbunsetsu = bushuBgnBun(&st, yomi, length)) == NG) { killmenu(d); (void)GLineNGReturn(d); return -1; } if((nbunsetsu != 1) || (st.klen > 1) || (st.maxcand == 0)) { /* Éô¼ó¤È¤·¤Æ¤Î¸õÊ䤬¤Ê¤¤ */ d->kanji_status_return->length = -1; makeBushuIchiranQuit(d, flag); currentModeInfo(d); killmenu(d); if(flag) { makeGLineMessageFromString(d, "\244\263\244\316\311\364\274\363\244\316\270\365\312\344\244\317\244\242\244\352\244\336\244\273\244\363"); /* ¤³¤ÎÉô¼ó¤Î¸õÊä¤Ï¤¢¤ê¤Þ¤»¤ó */ } else { return(NothingChangedWithBeep(d)); } return(0); } /* ¸õÊä°ìÍ÷¹Ô¤òɽ¼¨¤¹¤ë */ /* 0 ¤Ï¡¢¥«¥ì¥ó¥È¸õÊä + 0 ¤ò¥«¥ì¥ó¥È¸õÊä¤Ë¤¹¤ë¤³¤È¤ò¼¨¤¹ */ if((allBushuCands = getIchiranList(defaultBushuContext, &nelem, ¤tkouho)) == 0) { killmenu(d); (void)GLineNGReturn(d); return -1; } /* Éô¼óÊÑ´¹¤Ï³Ø½¬¤·¤Ê¤¤¡£ */ if(RkwEndBun(defaultBushuContext, 0) == -1) { /* 0:³Ø½¬¤·¤Ê¤¤ */ if(errno == EPIPE) jrKanjiPipeError(); jrKanjiError = "\244\253\244\312\264\301\273\372\312\321\264\271\244\316\275\252\316\273\244\313\274\272\307\324\244\267\244\336\244\267\244\277"; /* ¤«¤Ê´Á»úÊÑ´¹¤Î½ªÎ»¤Ë¼ºÇÔ¤·¤Þ¤·¤¿ */ freeGetIchiranList(allBushuCands); killmenu(d); (void)GLineNGReturn(d); return -1; } if(getForIchiranContext(d) == NG) { freeGetIchiranList(allBushuCands); killmenu(d); (void)GLineNGReturn(d); return -1; } fc = (forichiranContext)d->modec; fc->allkouho = allBushuCands; if (!cannaconf.HexkeySelect) inhibit |= (unsigned char)NUMBERING; fc->curIkouho = currentkouho; /* ¸½ºß¤Î¥«¥ì¥ó¥È¸õÊäÈÖ¹æ¤òÊݸ¤¹¤ë */ currentkouho = 0; /* ¥«¥ì¥ó¥È¸õÊ䤫¤é²¿ÈÖÌܤò¥«¥ì¥ó¥È¸õÊä¤È¤¹¤ë¤« */ if((retval = selectOne(d, fc->allkouho, &fc->curIkouho, nelem, BANGOMAX, inhibit, currentkouho, WITH_LIST_CALLBACK, bushuEveryTimeCatch, bushuExitCatch, quitfunc, uiUtilIchiranTooSmall)) == NG) { freeGetIchiranList(allBushuCands); killmenu(d); (void)GLineNGReturnFI(d); return -1; } ic = (ichiranContext)d->modec; if(!flag) { /* convertAsBushu */ ic->majorMode = ic->minorMode = CANNA_MODE_BushuMode; } else { if(ext) { ic->majorMode = ic->minorMode = CANNA_MODE_BushuMode; } else { ic->majorMode = CANNA_MODE_ExtendMode; ic->minorMode = CANNA_MODE_BushuMode; } } currentModeInfo(d); /* ¸õÊä°ìÍ÷¹Ô¤¬¶¹¤¯¤Æ¸õÊä°ìÍ÷¤¬½Ð¤»¤Ê¤¤ */ if(ic->tooSmall) { d->status = AUX_CALLBACK; killmenu(d); return(retval); } if ( !(ic->flags & ICHIRAN_ALLOW_CALLBACK) ) { makeGlineStatus(d); } /* d->status = EVERYTIME_CALLBACK; */ return(retval); }
bool NETHER::option_cycle(unsigned char *keyboard) { switch(game_state) { case STATE_PAUSE: if (keyboard[fire_key] && !old_keyboard[fire_key]) { switch(option_menu) { case 0: game_state=STATE_PLAYING; break; case 1: game_state=STATE_LOADINGGAME; option_menu=0; break; case 2: game_state=STATE_SAVINGGAME; option_menu=0; break; case 3: return false; break; } /* if */ } /* if */ if (keyboard[down_key] && !old_keyboard[down_key]) { option_menu++; if (option_menu>=4) option_menu=0; } /* if */ if (keyboard[up_key] && !old_keyboard[up_key]) { option_menu--; if (option_menu<0) option_menu=3; } /* if */ break; case STATE_SAVINGGAME: if (keyboard[fire_key] && !old_keyboard[fire_key]) { switch(option_menu) { case 0: game_state=STATE_PAUSE; option_menu=2; break; case 1: case 2: case 3: case 4: { char filename[80]; sprintf(filename,"savedgame%i.txt",option_menu-1); save_game(filename); //save_debug_report("debugreport.txt"); game_state=STATE_PAUSE; option_menu=2; redrawmenu=2; redrawradar=1; } } /* if */ } /* if */ if (keyboard[down_key] && !old_keyboard[down_key]) { option_menu++; if (option_menu>=5) option_menu=0; } /* if */ if (keyboard[up_key] && !old_keyboard[up_key]) { option_menu--; if (option_menu<0) option_menu=4; } /* if */ break; case STATE_LOADINGGAME: if (keyboard[fire_key] && !old_keyboard[fire_key]) { switch(option_menu) { case 0: game_state=STATE_PAUSE; option_menu=1; break; case 1: case 2: case 3: case 4: { char filename[80]; sprintf(filename,"savedgame%i.txt",option_menu-1); killmenu(act_menu); load_game(filename); newmenu(act_menu); redrawmenu=2; recomputestatistics=true; game_finished=0; game_started=INTRO_TIME; game_state=STATE_PAUSE; option_menu=2; } } /* switch */ } /* if */ if (keyboard[down_key] && !old_keyboard[down_key]) { option_menu++; if (option_menu>=5) option_menu=0; } /* if */ if (keyboard[up_key] && !old_keyboard[up_key]) { option_menu--; if (option_menu<0) option_menu=4; } /* if */ break; } /* switch */ return true; } /* NETHER::option_cycle */