int shiftWindowLeft (unsigned int amount) { #ifdef ENABLE_CONTRACTED_BRAILLE if (isContracting()) { int reference = ses->winx; int first = 0; int last = ses->winx - 1; while (first <= last) { int end = (ses->winx = (first + last) / 2) + getContractedLength(amount); if (end < reference) { first = ses->winx + 1; } else { last = ses->winx - 1; } } if (first == reference) { if (!first) return 0; first -= 1; } ses->winx = first; return 1; } #endif /* ENABLE_CONTRACTED_BRAILLE */ return moveWindowLeft(amount); }
int shiftWindowRight (unsigned int amount) { #ifdef ENABLE_CONTRACTED_BRAILLE if (isContracting()) amount = getContractedLength(amount); #endif /* ENABLE_CONTRACTED_BRAILLE */ return moveWindowRight(amount); }
static int getWindowLength (void) { #ifdef ENABLE_CONTRACTED_BRAILLE if (isContracting()) return getContractedLength(textCount); #endif /* ENABLE_CONTRACTED_BRAILLE */ return textCount; }
void placeRightEdge (int column) { #ifdef ENABLE_CONTRACTED_BRAILLE if (isContracting()) { ses->winx = 0; while (1) { int length = getContractedLength(textCount); int end = ses->winx + length; if (end > column) break; if (end == ses->winx) break; ses->winx = end; } } else #endif /* ENABLE_CONTRACTED_BRAILLE */ { ses->winx = column / textCount * textCount; } }