Example #1
0
void AwShape::onResourceChanged (const Torque::Path &path)
{
	AwManager::removeShape (this);
	AwManager::addShape (this);

	updateMapping ();
}
void PFSViewWidget::paintEvent( QPaintEvent *event )
{
  assert( pfsFrame != NULL );

  QRect clip = event->rect();
  int clipx = clip.x();
  int clipy = clip.y();
  int clipw = clip.width();
  int cliph = clip.height();
  
  
  if( updateMappingRequested )
    updateMapping();
  
  QPainter p( this );
//  if( image != NULL ) p->drawImage( 0, 0, *image );
  if( image != NULL ) {
      p.drawImage( clipx, clipy, *image, clipx, clipy, clipw, cliph );

    //Erase area outside image
    if( clipx+clipw > image->width() )
      p.eraseRect( image->width(), 0, clipx+clipw - image->width(), image->height() );
    if( clipy+cliph > image->height() )
      p.eraseRect( 0, image->height(), image->width(), clipy+cliph - image->height() );
    if( clipx+clipw > image->width() && clipy+cliph > image->height() )
      p.eraseRect( image->width(), image->height(),
        clipx+clipw - image->width(), clipy+cliph - image->height() );
    
  }
  
  
}
pid_t dmtcp::VirtualPidTable::realToVirtual(pid_t realPid)
{
  if (realPid == -1 || realPid == 0) {
    return realPid;
  }

  /* This code is called from MTCP while the checkpoint thread is holding
     the JASSERT log lock. Therefore, don't call JTRACE/JASSERT/JINFO/etc. in
     this function. */
  _do_lock_tbl();
  for (pid_iterator i = _pidMapTable.begin(); i != _pidMapTable.end(); ++i) {
    if ( realPid == i->second ) {
      _do_unlock_tbl();
      return i->first;
    }
  }

  if (dmtcp_is_ptracing != 0 && dmtcp_is_ptracing()) {
    pid_t virtualPid = readVirtualTidFromFileForPtrace(gettid());
    if (virtualPid != -1) {
      _do_unlock_tbl();
      updateMapping(virtualPid, realPid);
      return virtualPid;
    }
  }

  //JWARNING(false) (realPid)
    //.Text("No virtual pid/tid found for the given real pid");
  _do_unlock_tbl();
  return realPid;
}
Example #4
0
void Stack::removeDocument(int index)
{
	Document* document = m_documents.takeAt(index);
	m_contents->removeWidget(document);
	emit documentRemoved(document);
	document->deleteLater();
	updateMapping();
}
Example #5
0
void Stack::addDocument(Document* document)
{
	document->setSceneList(m_scenes);
	connect(document, SIGNAL(alert(Alert*)), m_alerts, SLOT(addAlert(Alert*)));
	connect(document, SIGNAL(alignmentChanged()), this, SIGNAL(updateFormatAlignmentActions()));
	connect(document, SIGNAL(changedName()), this, SIGNAL(updateFormatActions()));
	connect(document, SIGNAL(changedName()), this, SLOT(updateMapping()));
	connect(document, SIGNAL(footerVisible(bool)), this, SLOT(setFooterVisible(bool)));
	connect(document, SIGNAL(headerVisible(bool)), this, SLOT(setHeaderVisible(bool)));
	connect(document, SIGNAL(scenesVisible(bool)), this, SLOT(setScenesVisible(bool)));
	connect(document->text(), SIGNAL(copyAvailable(bool)), this, SIGNAL(copyAvailable(bool)));
	connect(document->text(), SIGNAL(redoAvailable(bool)), this, SIGNAL(redoAvailable(bool)));
	connect(document->text(), SIGNAL(undoAvailable(bool)), this, SIGNAL(undoAvailable(bool)));
	connect(document->text(), SIGNAL(currentCharFormatChanged(QTextCharFormat)), this, SIGNAL(updateFormatActions()));

	m_documents.append(document);
	m_contents->addWidget(document);
	m_contents->setCurrentWidget(document);
	updateMapping();

	emit documentAdded(document);
	emit updateFormatActions();
}
Example #6
0
bool AwShape::onAdd ()
{
	if (!Parent::onAdd ())
	{
		return false;
	}

	// If on the server, do nothing.
	if (isServerObject ())
	{
		return true;
	}

	ResourceManager::get ().getChangedSignal ().notify (this, &AwShape::onResourceChanged);
	AwManager::addShape (this);
	updateMapping ();
	return true;
}
Example #7
0
void Stack::moveDocument(int from, int to)
{
	m_documents.move(from, to);
	updateMapping();
}