コード例 #1
0
ファイル: braille.c プロジェクト: MarkMielke/brltty
static int
brl_writeWindow (BrailleDisplay *brl, const wchar_t *text) {
  if (cellsHaveChanged(outputBuffer, brl->buffer, brl->textColumns, NULL, NULL, NULL)) {
    writeCells(brl);
  }
  return 1;
}
コード例 #2
0
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" );
}
コード例 #3
0
ファイル: braille.c プロジェクト: plundblad/brltty
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;
}
コード例 #4
0
ファイル: document.cpp プロジェクト: ABratovic/open-watcom-v2
// 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
}
コード例 #5
0
ファイル: braille.c プロジェクト: MarkMielke/brltty
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;
}
コード例 #6
0
static int
clearCells (BrailleDisplay *brl) {
  memset(brl->data->previousCells, 0, MIN(brl->textColumns*brl->textRows, MAXIMUM_CELL_COUNT));
  return writeCells(brl);
}