static int brl_writeWindow (BrailleDisplay *brl, const wchar_t *text) { if (cellsHaveChanged(outputBuffer, brl->buffer, brl->textColumns, NULL, NULL, NULL)) { writeCells(brl); } return 1; }
void GuiSelectBoundaryCodes::saveSelectionAsGrid() { getSelectedItems(m_Ui.listWidget, m_DisplayBoundaryCodes); QVector <vtkIdType> selected_cells; getSurfaceCells(m_DisplayBoundaryCodes, selected_cells, m_Grid); writeCells(m_Grid, selected_cells, GuiMainWindow::pointer()->getFilePath() + "selection.vtu" ); }
static int brl_writeWindow (BrailleDisplay *brl, const wchar_t *text) { if (inputMode->modifyWindow) inputMode->modifyWindow(brl); updateCells(textCells, brl->buffer, sizeof(textCells)); if (refreshNeeded && !inputMode->temporary) { writeCells(brl); refreshNeeded = 0; } return 1; }
// Write the file void Document::write( std::FILE *out ) { hdr->write( out ); //write the header hdr->panelCount = static_cast< STD1::uint16_t>( resMap.size() ); hdr->panelOffset = writeResMap( out ); hdr->nameCount = !isInf() ? static_cast< STD1::uint16_t >( nameMap.size() ) : 0; hdr->nameOffset = writeNameMap( out ); eHdr->gNameOffset = gnames->write( out ); eHdr->gNameCount = gnames->size(); hdr->imageOffset = writeBitmaps( out ); hdr->tocCount = static_cast< STD1::uint16_t >( pages.size() ); hdr->tocOffset = writeTOCs( out ); hdr->tocOffsetOffset = writeTOCOffsets( out ); writeSynonyms( out ); hdr->indexOffset = writeIndex( out ); hdr->icmdOffset = writeICmd( out ); hdr->nlsOffset = nls->write( out ); hdr->nlsSize = nls->length(); eHdr->stringsOffset = strings->write( out ); eHdr->stringsSize = static_cast< STD1::uint16_t >( strings->length() ); eHdr->dbOffset = extfiles->write( out ); eHdr->dbCount = static_cast< STD1::uint16_t >( extfiles->size() ); eHdr->dbSize = extfiles->length(); eHdr->fontOffset = fonts->write( out ); eHdr->fontCount = static_cast< STD1::uint16_t >( fonts->size() ); eHdr->ctrlOffset = controls->write( out ); eHdr->ctrlSize = controls->length(); hdr->dictOffset = dict->write( out ); hdr->dictSize = dict->length(); hdr->dictCount = dict->size(); writeCells( out ); hdr->cellCount = static_cast< STD1::uint16_t >( cells.size() ); hdr->cellOffsetOffset = writeCellOffsets( out ); eHdr->childPagesOffset = writeChildWindows( out ); if( compiler.searchable() ) { hdr->searchOffset = dict->writeFTS( out, hdr->recSize ); hdr->searchSize = dict->ftsLength(); } hdr->extOffset = eHdr->write( out ); hdr->write( out ); //rewrite the header to update the offsets }
static int brl_construct (BrailleDisplay *brl, char **parameters, const char *device) { if (!isSerialDevice(&device)) { unsupportedDevice(device); return 0; } if ((serialDevice = serialOpenDevice(device))) { static const unsigned int baud = 9600; charactersPerSecond = baud / 10; if (serialRestartDevice(serialDevice, baud)) { if (identifyDisplay(brl)) { { static const DotsTable dots = { 0X01, 0X02, 0X04, 0X10, 0X20, 0X40, 0X08, 0X80 }; makeOutputTable(dots); } if ((outputBuffer = malloc(brl->textColumns))) { if (setTable(brl, 0)) { memset(outputBuffer, 0, brl->textColumns); writeCells(brl); return 1; } free(outputBuffer); outputBuffer = NULL; } else { logSystemError("Output buffer allocation"); } } } serialCloseDevice(serialDevice); serialDevice = NULL; } return 0; }
static int clearCells (BrailleDisplay *brl) { memset(brl->data->previousCells, 0, MIN(brl->textColumns*brl->textRows, MAXIMUM_CELL_COUNT)); return writeCells(brl); }