int redraw_nisemono () { call_t_redraw_move (c_b->t_c_p, c_b->t_c_p, c_b->maxlen, 2, 1); check_scroll (); return (0); }
int main() { init(); while(true) { check_right(); check_left(); check_move(); check_scroll(); // wait(0.005); } }
void ztc_put_char(int ch) { fg_box_t temp_box; msm_hidecursor(); if (in_graphics_mode && !in_splitscreen) lsplitscreen(NIL); if (ch != '\1' && ch != '\2') { if (in_graphics_mode) { if (ch == '\n') { ztc_graph_textx = 0; if (ztc_graph_texty - texth >= 0) ztc_graph_texty -= texth; else check_scroll(); } else if (ch == '\b') { if (ztc_graph_textx > 0) fg_adjustxy(FG_ROT180, 1, &ztc_graph_textx, &ztc_graph_texty, fg.charbox); } else if (ch == '\t') { fg_adjustxy(FG_ROT0, 8 - (x_coord&07), &ztc_graph_textx, &ztc_graph_texty, fg.charbox); if (ztc_graph_textx >= MaxX) print_char(stdout,'\n'); } else { if (ztc_text_bgcolor != 0) { temp_box[FG_X1] = temp_box[FG_X2] = ztc_graph_textx; temp_box[FG_Y1] = temp_box[FG_Y2] = ztc_graph_texty; fg_adjustxy(FG_ROT0, 2, &temp_box[FG_X2], &temp_box[FG_Y2], fg.charbox); temp_box[FG_Y2] += texth-1; fg_fillbox(ztc_text_bgcolor, FG_MODE_SET, ~0, temp_box); } fg_putc(ztc_textcolor, FG_MODE_SET, ~0, FG_ROT0, ztc_graph_textx, ztc_graph_texty, ch, fg.displaybox); fg_adjustxy(FG_ROT0, 1, &ztc_graph_textx, &ztc_graph_texty, fg.charbox); if (ztc_graph_textx >= MaxX) print_char(stdout,'\n'); } } else disp_putc(ch); } msm_showcursor(); }
void menu_motion(WMenu *menu, XMotionEvent *ev, int dx, int dy) { menu_select_entry_at(menu, ev->x_root, ev->y_root); check_scroll(menu, ev->x_root, ev->y_root); }
int buffer_in () { unsigned int c; int ret; unsigned int romkan; int ignored = 0; int in; unsigned int *output; while (1) { in = keyin (); output = romkan_henkan (in); conv_ltr_to_ieuc (output); if (input_func) (*input_func) (output, output); for (; *output != EOLTTR; output++) { c = ((romkan = *output) & 0x0000ffff); if (isSPCL (romkan)) { if (romkan == REDRAW) { (*c_b->redraw_fun) (); continue; } else if (romkan == CHMSIG) { /* mode changed */ if (redraw_when_chmsig_func) (*redraw_when_chmsig_func) (); disp_mode (); continue; } else if (romkan == NISEBP) { /* error */ ring_bell (); continue; } else { continue; /* if (romkan == EOLTTR) */ } } if (ignored) { if (isNISE (romkan)) { if (c == rubout_code) { --ignored; } else { ++ignored; } } else { ignored = 0; } continue; } if (isNISE (romkan) && (ESCAPE_CHAR (c) || NOT_NORMAL_CHAR (c)) && c != rubout_code) { ++ignored; continue; } if (c < TBL_SIZE && c_b->key_table[c]) { if (c_b->rk_clear_tbl[c]) romkan_clear (); ret = (*c_b->key_table[c]) (c, romkan); } else if (c >= 0x80 && c <= 0x9f) { ret = 0; ring_bell (); } else if (!(ESCAPE_CHAR (c)) || c == 0x09) { /* TAB is not ESCAPE char */ if (c_b->maxlen < c_b->buflen) { if (c_b->key_in_fun) { ret = (*c_b->key_in_fun) (c, romkan); } else { ret = insert_char (c); call_t_redraw_move (c_b->t_c_p + 1, c_b->t_c_p, c_b->maxlen, 0, 1); check_scroll (); kk_cursor_normal (); } } else { romkan_clear (); ret = 0; } } else { if (c_b->ctrl_code_fun) { ret = (*c_b->ctrl_code_fun) (c, romkan); } else { ret = 0; ring_bell (); } } if (ret == 1) { return (0); } else if (ret == -1) { return (-1); } } } }