static int readCharacters_AtSpiScreen (const ScreenBox *box, ScreenCharacter *buffer) { long x,y; clearScreenCharacters(buffer,box->height*box->width); pthread_mutex_lock(&updateMutex); if (!curTerm) { setScreenMessage(box, buffer, nonatspi); goto out; } if (!curNumRows) { goto out; } if (!validateScreenBox(box, curNumCols, curNumRows)) { goto out; } for (y=0; y<box->height; y++) { if (curRowLengths[box->top+y]) { for (x=0; x<box->width; x++) { if (box->left+x<curRowLengths[box->top+y] - (curRows[box->top+y][curRowLengths[box->top+y]-1]=='\n')) { buffer[y*box->width+x].text = curRows[box->top+y][box->left+x]; } } } } out: pthread_mutex_unlock(&updateMutex); return 1; }
static int readCharacters_NoScreen (const ScreenBox *box, ScreenCharacter *buffer) { ScreenDescription description; describe_NoScreen(&description); if (!validateScreenBox(box, description.cols, description.rows)) return 0; setScreenMessage(box, buffer, screenMessage); return 1; }