void next_input_focus(void) { InputItem *old_item = gWindow->page->current_item, *new_item, *trace; if (gWindow->page->current_item == NULL || (gWindow->page->current_item->next == NULL && gWindow->page->current_item == gWindow->page->input_list)) { BeepAtTheUser(); return; } /* * Now I should find the new item */ new_item = NULL; trace = old_item->next; if (trace == NULL) new_item = gWindow->page->input_list; else new_item = trace; gWindow->page->current_item = new_item; draw_inputsymbol(old_item); draw_inputsymbol(new_item); }
static void show_input(TextNode *node) { /*XFontStruct *old_font;*/ XWindowChanges wc; /*int twidth, boxwidth, old_color;*/ /*Window root, child;*/ /*int root_x, root_y, win_x, win_y, buttons;*/ InputItem *item; char *inpbuffer; item = node->link->reference.string; inpbuffer = item->curr_line->buffer; wc.border_width = 0; wc.x = node->x; wc.y = node->y + gRegionOffset + y_off - node->height + 2; wc.height = node->height - 2; wc.width = node->width; if (pix_visible(node->y, node->height)) { XConfigureWindow(gXDisplay, node->link->win, CWX | CWY | CWHeight | CWWidth | CWBorderWidth, &wc); XMapWindow(gXDisplay, node->link->win); } XFlush(gXDisplay); draw_inputsymbol(item); }
void prev_input_focus(void) { InputItem *old_item = gWindow->page->current_item, *new_item, *trace; if (gWindow->page->current_item == NULL) { BeepAtTheUser(); return; } /* * Now I should find the new item */ new_item = NULL; trace = gWindow->page->input_list; if (trace == old_item) { /* * I started at the front of the list, so move forward until I hit * the end */ while (trace->next != NULL) trace = trace->next; new_item = trace; } else { while (trace->next != old_item) trace = trace->next; new_item = trace; } gWindow->page->current_item = new_item; draw_inputsymbol(old_item); draw_inputsymbol(new_item); }