本文整理汇总了C++中DocumentUndo::isEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ DocumentUndo::isEnabled方法的具体用法?C++ DocumentUndo::isEnabled怎么用?C++ DocumentUndo::isEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentUndo
的用法示例。
在下文中一共展示了DocumentUndo::isEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deselectMask
void DocumentApi::deselectMask()
{
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::SetMask(getObjects(),
m_document));
m_document->setMaskVisible(false);
}
示例2: setMaskPosition
void DocumentApi::setMaskPosition(int x, int y)
{
ASSERT(m_document->getMask());
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::SetMaskPosition(getObjects(), m_document));
m_document->getMask()->setOrigin(x, y);
m_document->resetTransformation();
}
示例3: copyToCurrentMask
void DocumentApi::copyToCurrentMask(Mask* mask)
{
ASSERT(m_document->getMask());
ASSERT(mask);
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::SetMask(getObjects(),
m_document));
m_document->getMask()->copyFrom(mask);
}
示例4: configureLayerAsBackground
void DocumentApi::configureLayerAsBackground(LayerImage* layer)
{
// Add undoers.
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled()) {
m_undoers->pushUndoer(new undoers::SetLayerFlags(getObjects(), layer));
m_undoers->pushUndoer(new undoers::SetLayerName(getObjects(), layer));
m_undoers->pushUndoer(new undoers::MoveLayer(getObjects(), layer));
}
// Do the action.
layer->configureAsBackground();
}
示例5: restackLayerAfter
void DocumentApi::restackLayerAfter(Layer* layer, Layer* afterThis)
{
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::MoveLayer(getObjects(), layer));
layer->getParent()->stackLayer(layer, afterThis);
DocumentEvent ev(m_document);
ev.sprite(layer->getSprite());
ev.layer(layer);
m_document->notifyObservers<DocumentEvent&>(&DocumentObserver::onLayerRestacked, ev);
}
示例6: setConstantFrameRate
void DocumentApi::setConstantFrameRate(Sprite* sprite, int msecs)
{
// Add undoers.
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled()) {
for (FrameNumber fr(0); fr<sprite->getTotalFrames(); ++fr)
m_undoers->pushUndoer(new undoers::SetFrameDuration(
getObjects(), sprite, fr));
}
// Do the action.
sprite->setDurationForAllFrames(msecs);
}
示例7: setCelPosition
void DocumentApi::setCelPosition(Sprite* sprite, Cel* cel, int x, int y)
{
ASSERT(cel);
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::SetCelPosition(getObjects(), cel));
cel->setPosition(x, y);
DocumentEvent ev(m_document);
ev.sprite(sprite);
ev.cel(cel);
m_document->notifyObservers<DocumentEvent&>(&DocumentObserver::onCelPositionChanged, ev);
}
示例8: flipImage
void DocumentApi::flipImage(Image* image,
const gfx::Rect& bounds,
raster::algorithm::FlipType flipType)
{
// Insert the undo operation.
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled()) {
m_undoers->pushUndoer
(new undoers::FlipImage
(getObjects(), image, bounds, flipType));
}
// Flip the portion of the bitmap.
raster::algorithm::flip_image(image, bounds, flipType);
}
示例9: addImageInStock
// Adds a new image in the stock. Returns the image index in the
// stock.
int DocumentApi::addImageInStock(Sprite* sprite, Image* image)
{
ASSERT(image != NULL);
// Do the action.
int imageIndex = sprite->getStock()->addImage(image);
// Add undoers.
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::AddImage(getObjects(),
sprite->getStock(), imageIndex));
return imageIndex;
}
示例10: setSpriteSize
void DocumentApi::setSpriteSize(Sprite* sprite, int w, int h)
{
ASSERT(w > 0);
ASSERT(h > 0);
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::SetSpriteSize(getObjects(), sprite));
sprite->setSize(w, h);
DocumentEvent ev(m_document);
ev.sprite(sprite);
m_document->notifyObservers<DocumentEvent&>(&DocumentObserver::onSpriteSizeChanged, ev);
}
示例11: removeImageFromStock
// Removes and destroys the specified image in the stock.
void DocumentApi::removeImageFromStock(Sprite* sprite, int imageIndex)
{
ASSERT(imageIndex >= 0);
Image* image = sprite->getStock()->getImage(imageIndex);
ASSERT(image);
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::RemoveImage(getObjects(),
sprite->getStock(), imageIndex));
sprite->getStock()->removeImage(image);
delete image;
}
示例12: replaceStockImage
void DocumentApi::replaceStockImage(Sprite* sprite, int imageIndex, Image* newImage)
{
// Get the current image in the 'image_index' position.
Image* oldImage = sprite->getStock()->getImage(imageIndex);
ASSERT(oldImage);
// Replace the image in the stock.
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::ReplaceImage(getObjects(),
sprite->getStock(), imageIndex));
sprite->getStock()->replaceImage(imageIndex, newImage);
delete oldImage;
}
示例13: setCelFramePosition
void DocumentApi::setCelFramePosition(Sprite* sprite, Cel* cel, FrameNumber frame)
{
ASSERT(cel);
ASSERT(frame >= 0);
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::SetCelFrame(getObjects(), cel));
cel->setFrame(frame);
DocumentEvent ev(m_document);
ev.sprite(sprite);
ev.cel(cel);
ev.frame(frame);
m_document->notifyObservers<DocumentEvent&>(&DocumentObserver::onCelFrameChanged, ev);
}
示例14: addCel
void DocumentApi::addCel(LayerImage* layer, Cel* cel)
{
ASSERT(layer);
ASSERT(cel);
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::AddCel(getObjects(), layer, cel));
layer->addCel(cel);
DocumentEvent ev(m_document);
ev.sprite(layer->getSprite());
ev.layer(layer);
ev.cel(cel);
m_document->notifyObservers<DocumentEvent&>(&DocumentObserver::onAddCel, ev);
}
示例15: setFrameDuration
void DocumentApi::setFrameDuration(Sprite* sprite, FrameNumber frame, int msecs)
{
// Add undoers.
DocumentUndo* undo = m_document->getUndo();
if (undo->isEnabled())
m_undoers->pushUndoer(new undoers::SetFrameDuration(
getObjects(), sprite, frame));
// Do the action.
sprite->setFrameDuration(frame, msecs);
// Notify observers.
DocumentEvent ev(m_document);
ev.sprite(sprite);
ev.frame(frame);
m_document->notifyObservers<DocumentEvent&>(&DocumentObserver::onFrameDurationChanged, ev);
}