Exemplo n.º 1
0
bool
WebGLFramebuffer::HasIncompleteAttachments() const
{
    bool hasIncomplete = false;

    for (size_t i = 0; i < (size_t)mColorAttachments.Length(); i++) {
        hasIncomplete |= IsIncomplete(mColorAttachments[i]);
    }

    hasIncomplete |= IsIncomplete(mDepthAttachment);
    hasIncomplete |= IsIncomplete(mStencilAttachment);
    hasIncomplete |= IsIncomplete(mDepthStencilAttachment);

    return hasIncomplete;
}
Exemplo n.º 2
0
TPicResult
TPXPictureValidator::CheckComplete(uint termCh, uint& i, TPicResult rslt)
{
  uint j = i;
  if (IsIncomplete(rslt)) {
    // Skip optional pieces
    for (;;) {
      if (Pic[j] == _T('['))
        ToGroupEnd(termCh, j);

      else if (Pic[j] == _T('*')) {
        if (!isdigit((tchar)Pic[j+1])) {
          j++;
          ToGroupEnd(termCh, j);
        }
        else
          break;
      }
      else
        break;

      if (j == termCh)
        return prAmbiguous;  // end of the string, don't know if complete
    }
  }
  return rslt;
}
Exemplo n.º 3
0
bool
WebGLFramebuffer::HasIncompleteAttachments() const
{
    bool hasIncomplete = false;

    hasIncomplete |= IsIncomplete(mColorAttachment0);
    hasIncomplete |= IsIncomplete(mDepthAttachment);
    hasIncomplete |= IsIncomplete(mStencilAttachment);
    hasIncomplete |= IsIncomplete(mDepthStencilAttachment);

    const size_t moreColorAttachmentCount = mMoreColorAttachments.Length();
    for (size_t i = 0; i < moreColorAttachmentCount; i++) {
        hasIncomplete |= IsIncomplete(mMoreColorAttachments[i]);
    }

    return hasIncomplete;
}
Exemplo n.º 4
0
//
/// Process a picture group
//
TPicResult
TPXPictureValidator::Group(LPTSTR input, uint termCh, uint& i, uint& j)
{
  uint groupTermCh = CalcTerm(termCh, i);
  i++;
  TPicResult rslt = Process(input, groupTermCh - 1, i, j);
  if (!IsIncomplete(rslt))
    i = groupTermCh;
  return rslt;
}
Exemplo n.º 5
0
TPicResult
TPXPictureValidator::Scan(LPTSTR input, uint termCh, uint& i, uint& j)
{
  tchar ch;
  TPicResult rslt = prEmpty;

  uint len = ::_tcslen(input);
  while (i != termCh && Pic[i] != _T(',')) {
    if (j >= len)
      return CheckComplete(termCh, i, rslt);

    ch = input[j];
    switch (Pic[i]) {
      case _T('#'):
        if (!_istdigit((tchar)ch))
          return prError;
        else {
          input[j++] = ch;
          i++;
        }
        break;
      case _T('?'):
        if (!_istalpha((tchar)ch))
          return prError;
        else {
          input[j++] = ch;
          i++;
        }
        break;
      case _T('&'):
        if (!_istalpha((tchar)ch))
          return prError;
        else {
          input[j++] = (tchar)_totupper(ch);
          i++;
        }
        break;
      case _T('!'): {
#if defined(BI_DBCS_SUPPORT) 
        uint n = CharSize(&input[j]) / sizeof(tchar);
        if (j + n >= len)
          j = len;
        else{
          if (n == 1)
            input[j++] = (tchar)_totupper((tchar)ch);
          else
            j += n;
        }
#else
        input[j++] = (tchar)_totupper(ch);
#endif
        i++;
        break;
      }
      case _T('@'): {
#if defined(BI_DBCS_SUPPORT)
        uint n = CharSize(&input[j]) / sizeof(tchar);
        if (j + n >= len)
          j = len;
        else
          j += n;
#else
        input[j++] = ch;
#endif
        i++;
        break;
      }
      case _T('*'):
        rslt = Iteration(input, termCh, i, j);
        if (!IsComplete(rslt))
          return rslt;
        if (rslt == prError)
          rslt = prAmbiguous;
        break;
      case _T('{'):
        rslt = Group(input, termCh, i, j);
        if (!IsComplete(rslt))
          return rslt;
        break;
      case _T('['):
        rslt = Group(input, termCh, i, j);
        if (IsIncomplete(rslt))
          return rslt;
        if (rslt == prError)
          rslt = prAmbiguous;
        break;
      default: {
#if defined(BI_DBCS_SUPPORT)
#if defined(BI_PDOXWINJ_SUPPORT)
        // Paradox for Windows/J database program has two special picture to
        // support Japanese characters in CodePage 932
        //
        // '��' 0x81+0x93 - (2 byte '%' symbol)
        //      1 byte KATAKANA and KATAKANA symbols (0xA1 - 0xDF)
        // '��' 0x81+0x97 - (2 byte '@' symbol)
        //      any 2 byte characters except 2 byte space (0x81+0x40)
        //
        // This is hard coded, because we don't know how to get current
        // code page in Windows 3.1
        //
        uint n  = CharSize(&input[j]) / sizeof(tchar);
        uint n2 = CharSize(((const char *))Pic.c_str() + i) / sizeof(tchar);
        if (n2 == 2) {
          utchar uc1, uc2;
          uc1 = (utchar)Pic[i];
          uc2 = (utchar)Pic[i+1];
          if (uc1 == 0x81 && uc2 == 0x93) {
            if ((utchar)ch >= 0xA1 && (utchar)ch <= 0xDF){
              i += n2;
              j += n;
              break;
            }
            else
              return prError;
          } 
          else if (uc1 == 0x81 && uc2 == 0x97){
            if (n == 2 && j + n < len &&
                ((utchar)ch != 0x81 || (utchar)input[j+1] != 0x40)) {
              i += n2;
              j += n;
              break;
            } else
              return prError;
          }
        }
        if (n2 == 1 && Pic[i] == ';'){
          i++;
          n2 = CharSize((const char *)Pic.c_str() + i) / sizeof(tchar);
        }
#else
        if (Pic[i] == _T(';'))
          i++;
        uint n  = CharSize(&input[j]) / sizeof(tchar);
        uint n2 = CharSize((LPCTSTR)Pic.c_str() + i) / sizeof(tchar);
#endif
        if (j + n >= len)
          n = len - j;
        if (n == 1) {
          if (ch == _T(' ')) {
#if defined(BI_AUTO_COMPLETION_DBCS_BY_SPACE)
// But, couldn't expand input buffer TValidator classes.
//
            if (n < n2) {
              memmove(input+n2, input+n, len-n+1);
              len += n2 - n;
              n = n2;
            }
            while (n-- > 0)
              input[j++] = Pic[i++];
#else
            if (n != n2)
              return prError;
            input[j++] = Pic[i++];
#endif
          }
          else {
            if (n != n2)
              return prError;
            if (_totupper((tchar)Pic[i]) != _totupper((tchar)ch))
              return prError;
            input[j++] = Pic[i++];
          }
        }
        else {
          if (n > n2)
            return prError;
          for (uint i1 = 0; i1 < n; i1++)
            if (input[j+i1] != Pic[i+i1])
              return prError;
          while (n-- > 0)
            input[j++] = Pic[i++];
        }
#else
        if (Pic[i] == _T(';'))
          i++;
        if (_totupper(Pic[i]) != _totupper(ch))
          if (ch == _T(' '))
            ch = Pic[i];
          else
            return prError;
        input[j++] = Pic[i];
        i++;
#endif
      }
    }
    if (rslt == prAmbiguous)
      rslt = prIncompNoFill;
    else
      rslt = prIncomplete;
  }

  return (rslt == prIncompNoFill) ? prAmbiguous : prComplete;
}