Example #1
0
void ObjEdited(LPOBJECT lpObject, int iDirty, BOOL fEditedData, BOOL fEditedAlpha,
				LPRECT lpEditRect)
/***********************************************************************/
{
LPALPHA lpAlpha;

if (lpEditRect)
	OffsetRect(lpEditRect, -lpObject->rObject.left, -lpObject->rObject.top);
lpAlpha = lpObject->lpAlpha;
if (fEditedData)
	{
	lpObject->fChanged = YES;
	lpObject->DataDirty = iDirty;
	if (lpEditRect)
		PixmapAddUndoArea(&lpObject->Pixmap, lpEditRect);
	}
if (fEditedAlpha && lpAlpha)
	{
	lpObject->AlphaDirty = iDirty;
	if (lpEditRect)
		PixmapAddUndoArea(&lpAlpha->Pixmap, lpEditRect);
	}
lpObject->fBothDirty = fEditedData && fEditedAlpha;
if (lpEditRect)
	OffsetRect(lpEditRect, lpObject->rObject.left, lpObject->rObject.top);
}
Example #2
0
void CImage::EditedObject(LPOBJECT lpObject, int iDirty, LPRECT lpEditRect)
{
LPALPHA lpAlpha;
BOOL fEditedData, fEditedAlpha, fBase;

fBase = (lpObject == GetBase());
fEditedData = (lpObject->InitUndoType & UT_DATAUNDO) != 0;
fEditedAlpha = (lpObject->InitUndoType & UT_ALPHAUNDO) != 0;
if (lpEditRect)
	OffsetRect(lpEditRect, -lpObject->rObject.left, -lpObject->rObject.top);
lpAlpha = lpObject->lpAlpha;

	if (lpObject->lpText)
	   lpObject->lpText->Dirty = (iDirty == IDS_UNDOTEXT)? FALSE:TRUE;

if (fEditedData)
	{
    fChanged = YES;
	if (!(Control.NoUndo || fDisableUndos) && !lpObject->fUndoFailed)
		{
		lpObject->DataDirty = iDirty;
		if (lpEditRect)
			PixmapAddUndoArea(&lpObject->Pixmap, lpEditRect);
		}
	}
if (fEditedAlpha)
	{
	if (lpObject != GetBase())
        fChanged = YES;
	if (!(Control.NoUndo  || fDisableUndos) && (!fBase || Control.UndoMasks) &&
		!lpObject->fUndoFailed)
		{
		lpObject->AlphaDirty = iDirty;
		if (lpEditRect && lpAlpha)
			PixmapAddUndoArea(&lpAlpha->Pixmap, lpEditRect);
		}
	}
if (Control.NoUndo  || fDisableUndos)
	PurgeObjects();
if (!(Control.NoUndo  || fDisableUndos) && !lpObject->fUndoFailed && !lpObject->fBothDirty)
	lpObject->fBothDirty = fEditedData && fEditedAlpha;
if (lpEditRect)
	OffsetRect(lpEditRect, lpObject->rObject.left, lpObject->rObject.top);
}
Example #3
0
void ImgEditedObject(LPIMAGE lpImage, LPOBJECT lpObject, int iDirty, LPRECT lpEditRect)
/***********************************************************************/
{
LPALPHA lpAlpha;
BOOL fEditedData, fEditedAlpha, fBase;

fBase = (lpObject == ImgGetBase(lpImage));
fEditedData = (lpObject->InitUndoType & UT_DATAUNDO) != 0;
fEditedAlpha = (lpObject->InitUndoType & UT_ALPHAUNDO) != 0;
if (lpEditRect)
	OffsetRect(lpEditRect, -lpObject->rObject.left, -lpObject->rObject.top);
lpAlpha = lpObject->lpAlpha;
if (fEditedData)
	{
	lpObject->fChanged = YES;
	if (!Control.NoUndo && !lpObject->fUndoFailed)
		{
		lpObject->DataDirty = iDirty;
		if (lpEditRect)
			PixmapAddUndoArea(&lpObject->Pixmap, lpEditRect);
		}
	}
if (fEditedAlpha)
	{
	if (lpObject != ImgGetBase(lpImage))
		lpObject->fChanged = YES;
	if (!Control.NoUndo && (!fBase || Control.UndoMasks) &&
		!lpObject->fUndoFailed)
		{
		lpObject->AlphaDirty = iDirty;
		if (lpEditRect && lpAlpha)
			PixmapAddUndoArea(&lpAlpha->Pixmap, lpEditRect);
		}
	}
if (!Control.NoUndo && !lpObject->fUndoFailed && !lpObject->fBothDirty)
	lpObject->fBothDirty = fEditedData && fEditedAlpha;
if (lpEditRect)
	OffsetRect(lpEditRect, lpObject->rObject.left, lpObject->rObject.top);
}