Example #1
0
///////////////////////////////////////////////////////////////////////////////
// Write a specific sequence of commands that writes the plot.
///////////////////////////////////////////////////////////////////////////////
void Postscript_Dot_Plot::writeSpecificImageType( ofstream &out ) {

  // Write the plot border and grid lines.
  if( !error ) { writeGrid( out ); }

  // Write the dots on the plot.
  if( !error ) { writeDots( out ); }

}
Example #2
0
static int
brl_writeWindow (BrailleDisplay *brl, const wchar_t *text) {
  if (text) {
    if (wmemcmp(text, textCharacters, brailleCount) != 0) {
      const wchar_t *address = text;
      int count = brailleCount;

      writeString("Visual \"");

      while (count-- > 0) {
        wchar_t character = *address++;

        switch (character) {
          case WC_C('"'):
          case WC_C('\\'):
            writeCharacter(WC_C('\\'));
          default:
            writeCharacter(character);
            break;
        }
      }

      writeString("\"");
      writeLine();

      wmemcpy(textCharacters, text, brailleCount);
    }
  }

  if (cellsHaveChanged(brailleCells, brl->buffer, brailleCount, NULL, NULL, NULL)) {
    writeString("Braille \"");
    writeDots(brl->buffer, brailleCount);
    writeString("\"");
    writeLine();
  }

  return 1;
}
Example #3
0
static int
brl_writeStatus (BrailleDisplay *brl, const unsigned char *status) {
  int generic = status[GSC_FIRST] == GSC_MARKER;
  unsigned char *cells;
  int count;

  if (generic) {
    cells = genericCells;
    count = GSC_COUNT;
  } else {
    cells = statusCells;
    count = statusCount;
  }

  if (cellsHaveChanged(cells, status, count, NULL, NULL, NULL)) {
    if (generic) {
      int all = cells[GSC_FIRST] != GSC_MARKER;
      int i;

      for (i=1; i<count; ++i) {
        unsigned char value = status[i];
        if (all || (value != cells[i])) {
          static const char *const names[] = {
            [GSC_FIRST] = NULL,
            [gscBrailleWindowColumn] = "BRLCOL",
            [gscBrailleWindowRow] = "BRLROW",
            [gscScreenCursorColumn] = "CSRCOL",
            [gscScreenCursorRow] = "CSRROW",
            [gscScreenNumber] = "SCRNUM",
            [gscFrozenScreen] = "FREEZE",
            [gscDisplayMode] = "DISPMD",
            [gscTextStyle] = "SIXDOTS",
            [gscSlidingBrailleWindow] = "SLIDEWIN",
            [gscSkipIdenticalLines] = "SKPIDLNS",
            [gscSkipBlankBrailleWindows] = "SKPBLNKWINS",
            [gscShowScreenCursor] = "CSRVIS",
            [gscHideScreenCursor] = "CSRHIDE",
            [gscTrackScreenCursor] = "CSRTRK",
            [gscScreenCursorStyle] = "CSRSIZE",
            [gscBlinkingScreenCursor] = "CSRBLINK",
            [gscShowAttributes] = "ATTRVIS",
            [gscBlinkingAttributes] = "ATTRBLINK",
            [gscBlinkingCapitals] = "CAPBLINK",
            [gscAlertTunes] = "TUNES",
            [gscAutorepeat] = "AUTOREPEAT",
            [gscAutospeak] = "AUTOSPEAK",
            [gscBrailleInputMode] = "BRLUCDOTS"
          };
          const int nameCount = ARRAY_COUNT(names);

          if (i < nameCount) {
            const char *name = names[i];
            if (name) {
              char buffer[0X40];
              snprintf(buffer, sizeof(buffer), "%s %d", name, value);
              writeString(buffer);
              writeLine();
            }
          }
        }
      }
    } else {
      writeString("Status \"");
      writeDots(cells, count);
      writeString("\"");
      writeLine();
    }
  }