void PropertiesDock::on_RemoveTagButton_clicked()
{
    QTableView* TagTable = 0;
    switch (NowShowing)
    {
    case TrackPointUiShowing:
        TagTable = TrackPointUi.TagView; break;
    case RoadUiShowing:
        TagTable = RoadUi.TagView; break;
    case MultiShowing:
        TagTable = MultiUi.TagView; break;
    case RelationUiShowing:
        TagTable = RelationUi.TagView; break;
    default: break;
    }
    if (!TagTable) return;

    QModelIndexList indexes = TagTable->selectionModel()->selectedIndexes();
    if (indexes.isEmpty()) return;

    CommandList *L = 0;
    if (indexes.count()==1)
    {
        QModelIndex index = indexes.at(0);
        QModelIndex idx = index.sibling(index.row(),0);
        QVariant Content(theModel->data(idx,Qt::DisplayRole));
        if (Content.isValid())
        {
            QString KeyName = Content.toString();
            L = new CommandList(MainWindow::tr("Clear Tag '%1' on %2").arg(KeyName).arg(Selection[0]->id().numId), Selection[0]);
            for (int i=0; i<Selection.size(); ++i)
                if (Selection[i]->findKey(KeyName) != -1)
                    L->add(new ClearTagCommand(Selection[i],KeyName,Main->document()->getDirtyOrOriginLayer(Selection[i]->layer())));
        }
    }
    else
    {
        L = new CommandList(MainWindow::tr("Clear %1 tags on %2").arg(indexes.count()).arg(Selection[0]->id().numId), Selection[0]);
        while (!indexes.isEmpty()) {
            QModelIndex index = indexes.takeLast();
            QModelIndex idx = index.sibling(index.row(),0);
            QVariant Content(theModel->data(idx,Qt::DisplayRole));
            if (Content.isValid())
            {
                QString KeyName = Content.toString();
                for (int i=0; i<Selection.size(); ++i)
                    if (Selection[i]->findKey(KeyName) != -1)
                        L->add(new ClearTagCommand(Selection[i],KeyName,Main->document()->getDirtyOrOriginLayer(Selection[i]->layer())));
            }
        }
    }
    if (!L) return;
    if (L->empty()) {
        delete L;
    } else {
        Main->document()->addHistory(L);
        Main->invalidateView();
    }
}
Exemple #2
0
// private void OnPointerWheelChanged(object sender, Uno.Platform.PointerEventArgs args) [instance] :166
void DesktopRootViewport::OnPointerWheelChanged(uObject* sender, ::g::Uno::Platform::PointerEventArgs* args)
{
    uStackFrame __("Fuse.Desktop.DesktopRootViewport", "OnPointerWheelChanged(object,Uno.Platform.PointerEventArgs)");

    try
    {
        if (Content() != NULL)
            uPtr(args)->Handled(uPtr(::g::Fuse::Input::Pointer::RaiseWheelMoved(Content(), TranslatePointerEvent(args)))->IsHandled());
    }
    catch (const uThrowable& __t)
    {
        ::g::Uno::Exception* e = __t.Exception;
        ::g::Fuse::AppBase::OnUnhandledExceptionInternal(e);
    }
}
void PropertiesDock::on_RemoveMemberButton_clicked()
{
    if (CurrentMembersView)
    {
        Relation* R = dynamic_cast<Relation*>(Selection[0]);
        if (R) {
            QModelIndexList indexes = CurrentMembersView->selectionModel()->selectedIndexes();
            QModelIndex index;

            foreach(index, indexes)
            {
                QModelIndex idx = index.sibling(index.row(),0);
                QVariant Content(R->referenceMemberModel(Main)->data(idx,Qt::UserRole));
                if (Content.isValid())
                {
                    Feature* F = Content.value<Feature*>();
                    if (F) {
                        CommandList* L = new CommandList(MainWindow::tr("Remove member '%1' on %2").arg(F->description()).arg(R->description()), R);
                        if (R->find(F) < R->size())
                            L->add(new RelationRemoveFeatureCommand(R,F,Main->document()->getDirtyOrOriginLayer(R->layer())));
                        if (L->empty())
                            delete L;
                        else
                        {
                            Main->document()->addHistory(L);
                            Main->invalidateView();
                            return;
                        }
                    }
                }
            }
        }
    }
 virtual void OnRead()
   {
     assert(Read(0));
     state_mutex.Wait();
     state_joint = Content();
     state_mutex.Post();
   }
// return ETrue if the attachment passed in is the same
TBool CAgnAttachment::CompareL(const CAgnAttachment& aSource) const
	{
	if (Type() != aSource.Type())
		{
		return EFalse;
		}
	
	if (MimeType() != aSource.MimeType())
		{
		return EFalse;
		}
	
	if (Content() != aSource.Content())
		{
		return EFalse;
		}
	
	if (iAttributes != aSource.iAttributes)
		{
		return EFalse;
		}
	
	if (Label() != aSource.Label())
		{
		return EFalse;
		}
		
	if (Size() != aSource.Size())
		{
		return EFalse;
		}
	// Only properties exposed to clients are compared, i.e. not UIDs.
	
	return ETrue;
	}
  virtual void OnRead()
    {
      assert(Read(0));
      GyroPos& datum = Content();
//      printf("gyro %g %g %g\n", datum.y, datum.p, datum.r);
      head_state_manager.SetGyro(datum.y*M_PI/180.0, datum.p*M_PI/180.0,
				 datum.r*M_PI/180.0);
      //wake_up_call.Post();
    }
Exemple #7
0
void nsDisplayListSet::MoveTo(const nsDisplayListSet& aDestination) const
{
  aDestination.BorderBackground()->AppendToTop(BorderBackground());
  aDestination.BlockBorderBackgrounds()->AppendToTop(BlockBorderBackgrounds());
  aDestination.Floats()->AppendToTop(Floats());
  aDestination.Content()->AppendToTop(Content());
  aDestination.PositionedDescendants()->AppendToTop(PositionedDescendants());
  aDestination.Outlines()->AppendToTop(Outlines());
}
  virtual void OnRead()
    {
      assert(Read(0));
      JointPos& datum = Content();
//      printf("eye %g %g %g\n", datum(1), datum(2), datum(3));
      head_state_manager.SetEyes(datum(1), datum(2), datum(3));
//      head_state_manager.SetNeck(datum(6), datum(7), datum(4), datum(5));
      head_state_manager.SetNeck(datum(4), datum(5), datum(7), datum(6));
      head_state_manager.SetJoints(datum);
      wake_up_call.Post();
    }
void MainWindow::CreateAction()
{

    connect(actionClose,SIGNAL(triggered()),this,SLOT(close()));
    connect(actionAbout,SIGNAL(triggered()),this,SLOT(Abouts()));
    connect(actionContents,SIGNAL(triggered()),this,SLOT(Content()));





}
Exemple #10
0
// callback
void ArmMap::OnRead(void)
{
	ACE_OS::printf("ArmMap: loading new nnet");
	Read();
	YARPBPNNetState tmp;
	extract(Content(), tmp);
	load(tmp);
	_nUpdated++;
	if (_mode == atnr)
		_mode = learning;
	ACE_OS::printf("..done!\n");
}
 virtual void OnRead()
 {
   assert(Read(0));
   int x = Content();
   printf("Received command %d\n",x);
   //mode_cmd_mutex.Wait();
   //mode_cmd = x;
   //mode_cmd_time = YARPTime::GetTimeAsSeconds();
   int c = x;
   if (x>=100) c = x/100;
   Execute(c,x%100);
   //mode_cmd_mutex.Post();
 }
void CWSStarPassportHeaderInbound::EndElementL(const TDesC8& aNsUri,
                             const TDesC8& aLocalName,
                             const TDesC8& /*aQName*/)
    {
    TPtrC8 content = Content();
    switch (iState)
        {
        case KStateSave:
            {
            ResetContentL();
            iState = KStateIgnore;
            break;
            }
        case KStateParsingMainBrandID:
            {
            if (aNsUri == WSPassport32::KPassportFaultNamespaceXmlns)
                {
                if (aLocalName == WSPassport32::KCredProperty)
                    {
                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KMainBrandID,content);
                    ResetContentL();
                    iState = KStateParsingBrandIDList;
                    }
                }
            break;
            }            
        case KStateParsingBrandIDList:
            {
            if (aNsUri == WSPassport32::KPassportFaultNamespaceXmlns)
                {
                if (aLocalName == WSPassport32::KCredProperties)
                    {
                    ipBrandIdListElem->SetContentL(content);
                    HBufC8* xmlSnippet = ipBrandIdListElem->AsXmlL();
                    CleanupStack::PushL(xmlSnippet);
                    ((MSenContext*)iMessageContext)->Update(WSStarContextKeys::KBrandIDList,xmlSnippet);
                    CleanupStack::PopAndDestroy(xmlSnippet);
                    
                    ResetContentL();
                    iState = KStateIgnore;
                    }
                }
            break;
            }            
        default:
            break;
        }
    }
Exemple #13
0
void OrientationInput::OnRead()
{
	Read();

	YARPBabyBottle &tmp = Content();

	int msg = 0;
	if (tmp.readInt(&msg))
	{ 
		if (msg==1)
			_update(FROM_SIDE);
		else
			_update(FROM_ABOVE);
	}

}
void CSenPropertiesElement::WriteContentToL(RWriteStream& aWriteStream)
    {
    HBufC8* pEncoded = SenXmlUtils::EncodeHttpCharactersLC(Content());
    aWriteStream.WriteL(*pEncoded);
    CleanupStack::PopAndDestroy(pEncoded);
    }
void CIdWsfDsQueryResponse::EndElementL(
    const TDesC8& aNsUri,
    const TDesC8& aLocalName,
    const TDesC8& aQName)
    {
    switch(iState)
        {
        case KStateParsingResourceOffering:
            {
            if (aLocalName == KResourceOfferingName)
                {
                User::LeaveIfError(
                            iResourceOfferings.Append(ipResourceOffering));
                ipResourceOffering = NULL;
                iState = KStateIgnore;
                }
            else if (aLocalName == KResourceIdName ||
                        aLocalName == KEncryptedResourceIdName)
                {
                ipResourceOffering->SetResourceIdL(Content());
                }

            else if (aLocalName == KDescriptionElementLocalName)
                {
                ipResourceOffering->AddServiceInstanceL(ipServiceInstance);

                // alloc new instance for the next parsing cycle
                ipServiceInstance =
                        CIdWsfServiceInstance::NewL(*ipServiceInstance);
                break;
                }
            else
                {
                if (aLocalName == KProviderIdName)
                    {
                    ipServiceInstance->SetProviderIdL(Content());
                    break;
                    }
                else if (aLocalName == KSecurityMechIdName)
                    {
                    ipServiceInstance->AddSecurityMechL(Content());
                    break;
                    }
                else if (aLocalName == KCredentialRefName)
                    {
                    ipServiceInstance->AddCredentialRefL(Content());
                    break;
                    }
                else if (aLocalName == KEndpointName)
                    {
                    ipServiceInstance->SetEndPointL(Content());
                    break;
                    }
                else if (aLocalName == KServiceTypeName)
                    {
                    ipServiceInstance->SetServiceTypeL(Content());
                    break;
                    }
                else if (aLocalName == KOptionName)
                    {
                    CSenFacet* pFacet = CSenFacet::NewL();
                    CleanupStack::PushL( pFacet );
                    pFacet->SetNameL(Content());
                    pFacet->SetTypeL(KDiscoOption);
                    ipResourceOffering->SetFacetL(*pFacet);
                    CleanupStack::PopAndDestroy( pFacet ); // SetFacetL does not take ownership but makes a copy of the facet insteadfs
                    break;
                    }
                }
            break;
            }
        case KStateParsingEncryptedResourceId:
            {
            if (aLocalName == KResourceIdName ||
                aLocalName == KEncryptedResourceIdName)
                {
                ipResourceOffering->SetResourceIdL(Content());
                iState = KStateParsingResourceOffering;
                }
            else WriteEndElementL(aNsUri, aLocalName, aQName);
            break;
            }
        case KStateParsingCredentials:
            {
            if (aLocalName == KCredentialsName)
                {
                iNotOnOrAfter = Time::NullTTime();
                iState = KStateIgnore;
                }
            break;
            }
        case KStateParsingSingleCredential:
            {

            HBufC8* pAsXml = ipCredential->AsXmlL();
            CleanupStack::PushL(pAsXml);
            const TDesC8& refId = ipCredential->Id();

            if(pAsXml && refId.Length()>0)
                {
                ipCredential->DetachL();

                TInt count(iResourceOfferings.Count());
                for (TInt i = 0; i < count; i++)
                    {
                    iResourceOfferings[i]->AddCredentialL(*ipCredential);
                    }
                delete ipCredential;
                }
            else
                delete ipCredential; // ownership was _not_ transferred(!),
                                     // forced to delete here

            CleanupStack::PopAndDestroy(); // pAsXml;

            ipCredential = NULL;
            iState = KStateParsingCredentials;
            break;
            }
        default: // corresponds with ref-impl (Java) having case
                 // BaseFragment.IGNORE: break;
            {
            break;
            }
        }
    }
Exemple #16
0
INetPacket * INetPacket::CopyNew() const
{
	INetPacket* r = NEW_NETPACKET((uint32)Size(), _opcode);
	r->_Write(Content(), Size());
	return r;
};
Exemple #17
0
Content Entry::content() const
{
    return Content(firstElementByTagNameNS(atom1Namespace(),
                   QLatin1String("content")));
}
/// ParseDirective - Go through the comment and see if it indicates expected
/// diagnostics. If so, then put them in the appropriate directive list.
///
/// Returns true if any valid directives were found.
static bool ParseDirective(StringRef S, ExpectedData *ED, const llvm::SourceMgr &SM,
                           Lexer *PP, const SourceLocation& Pos,
                           VerifyDiagnosticConsumer::DirectiveStatus &Status) {
  DiagnosticsEngine &Diags = PP->getDiagnostics();

  // A single comment may contain multiple directives.
  bool FoundDirective = false;
  for (ParseHelper PH(S); !PH.Done();) {
    // Search for token: expected
    if (!PH.Search("expected", true))
      break;
    PH.Advance();

    // Next token: -
    if (!PH.Next("-"))
      continue;
    PH.Advance();

    // Next token: { error | warning | note }
    DirectiveList* DL = NULL;
    if (PH.Next("error"))
      DL = ED ? &ED->Errors : NULL;
    else if (PH.Next("warning"))
      DL = ED ? &ED->Warnings : NULL;
    else if (PH.Next("note"))
      DL = ED ? &ED->Notes : NULL;
    else if (PH.Next("no-diagnostics")) {
      if (Status == VerifyDiagnosticConsumer::HasOtherExpectedDirectives) {
        Diags.Report(Pos, diag::err_verify_invalid_no_diags)
          << /*IsExpectedNoDiagnostics=*/true;
      }
      else
        Status = VerifyDiagnosticConsumer::HasExpectedNoDiagnostics;
      continue;
    } else
      continue;
    PH.Advance();

    if (Status == VerifyDiagnosticConsumer::HasExpectedNoDiagnostics) {
      Diags.Report(Pos, diag::err_verify_invalid_no_diags)
        << /*IsExpectedNoDiagnostics=*/false;
      continue;
    }
    Status = VerifyDiagnosticConsumer::HasOtherExpectedDirectives;

    // If a directive has been found but we're not interested
    // in storing the directive information, return now.
    if (!DL)
      return true;

    // Default directive kind.
    bool RegexKind = false;
    const char* KindStr = "string";

    // Next optional token: -
    if (PH.Next("-re")) {
      PH.Advance();
      RegexKind = true;
      KindStr = "regex";
    }

    // Next optional token: @
    SourceLocation ExpectedLoc;
    if (!PH.Next("@")) {
      ExpectedLoc = Pos;
    } else {
      PH.Advance();
      unsigned Line = 0;
      bool FoundPlus = PH.Next("+");
      if (FoundPlus || PH.Next("-")) {
        // Relative to current line.
        PH.Advance();
        bool Invalid = false;
        unsigned ExpectedLine = SM.FindLineNumber(Pos);
        if (!Invalid && PH.Next(Line) && (FoundPlus || Line < ExpectedLine)) {
          if (FoundPlus) ExpectedLine += Line;
          else ExpectedLine -= Line;
          ExpectedLoc = translateLine(SM,SM.FindBufferContainingLoc(Pos), ExpectedLine);
        }
      } else if (PH.Next(Line)) {
        // Absolute line number.
        if (Line > 0)
          ExpectedLoc = translateLine(SM,SM.FindBufferContainingLoc(Pos), Line);
      }

      if (!ExpectedLoc.isValid()) {
        Diags.Report(getLocWithOffset(Pos,PH.C-PH.Begin),
                     diag::err_verify_missing_line) << KindStr;
        continue;
      }
      PH.Advance();
    }

    // Skip optional whitespace.
    PH.SkipWhitespace();

    // Next optional token: positive integer or a '+'.
    unsigned Min = 1;
    unsigned Max = 1;
    if (PH.Next(Min)) {
      PH.Advance();
      // A positive integer can be followed by a '+' meaning min
      // or more, or by a '-' meaning a range from min to max.
      if (PH.Next("+")) {
        Max = Directive::MaxCount;
        PH.Advance();
      } else if (PH.Next("-")) {
        PH.Advance();
        if (!PH.Next(Max) || Max < Min) {
          Diags.Report(getLocWithOffset(Pos,PH.C-PH.Begin),
                       diag::err_verify_invalid_range) << KindStr;
          continue;
        }
        PH.Advance();
      } else {
        Max = Min;
      }
    } else if (PH.Next("+")) {
      // '+' on its own means "1 or more".
      Max = Directive::MaxCount;
      PH.Advance();
    }

    // Skip optional whitespace.
    PH.SkipWhitespace();

    // Next token: {{
    if (!PH.Next("{{")) {
      Diags.Report(getLocWithOffset(Pos,PH.C-PH.Begin),
                   diag::err_verify_missing_start) << KindStr;
      continue;
    }
    PH.Advance();
    const char* const ContentBegin = PH.C; // mark content begin

    // Search for token: }}
    if (!PH.Search("}}")) {
      Diags.Report(getLocWithOffset(Pos,PH.C-PH.Begin),
                   diag::err_verify_missing_end) << KindStr;
      continue;
    }
    const char* const ContentEnd = PH.P; // mark content end
    PH.Advance();

    // Build directive text; convert \n to newlines.
    std::string Text;
    StringRef NewlineStr = "\\n";
    StringRef Content(ContentBegin, ContentEnd-ContentBegin);
    size_t CPos = 0;
    size_t FPos;
    while ((FPos = Content.find(NewlineStr, CPos)) != StringRef::npos) {
      Text += Content.substr(CPos, FPos-CPos);
      Text += '\n';
      CPos = FPos + NewlineStr.size();
    }
    if (Text.empty())
      Text.assign(ContentBegin, ContentEnd);

    // Construct new directive.
    Directive *D = Directive::create(RegexKind, Pos, ExpectedLoc, Text,
                                     Min, Max);
    std::string Error;
    if (D->isValid(Error)) {
      DL->push_back(D);
      FoundDirective = true;
    } else {
      Diags.Report(getLocWithOffset(Pos,ContentBegin-PH.Begin),
                   diag::err_verify_invalid_content)
        << KindStr << Error;
    }
  }

  return FoundDirective;
}
void CAgnAttachmentUri::ExternalizeL(RWriteStream& aStream) const
	{
	CAgnAttachment::ExternalizeL(aStream);
	aStream << Content();
	}