Beispiel #1
0
void REdgeOutlineSettings::Validate() const
{
	RObject::Validate();
	TpsAssertIsObject(REdgeOutlineSettings, this);
	TpsAssert(0 <= m_nEdgeOutlineWidth && m_nEdgeOutlineWidth <= 7, "Outline edge width not in range 0 - 7");
	TpsAssert(0 <= m_rcEdgeOutlineColor && m_rcEdgeOutlineColor <= 0x00ffffff, "Outline edge color in range 0 - 0x00ffffff");
}
Beispiel #2
0
// ****************************************************************************
//
//  Function Name:	RDeactivateComponentAction::Validate( )
//
//  Description:		Validates the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RDeactivateComponentAction::Validate( ) const
	{
	RUndoableAction::Validate();
	TpsAssertIsObject( RDeactivateComponentAction, this );
	TpsAssertValid( m_pParentView );
	TpsAssertValid( m_pComponentView );
	}
Beispiel #3
0
void RSoftGlowSettings::Validate() const
{
	RObject::Validate();
	TpsAssertIsObject( RSoftGlowSettings, this );
	TpsAssert( 0.0 <= m_fGlowOpacity && m_fGlowOpacity <= 1.0, "Soft glow opacity not in range 0 - 1" );
	TpsAssert( 0.0 <= m_fGlowEdgeSoftness && m_fGlowEdgeSoftness <= 1.0, "Soft glow edge softness not in range 0 - 1" );
}
Beispiel #4
0
// ****************************************************************************
//
//  Function Name:	RDragSelectionTracker::Validate( )
//
//  Description:		Validate the Object.
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RRotateSelectionTracker::Validate( ) const
	{
	RMouseTracker::Validate( );
	TpsAssertIsObject( RRotateSelectionTracker, this );
	TpsAssertValid( m_pView );
	TpsAssertValid( m_pSelection );
	}
Beispiel #5
0
// ****************************************************************************
//
//  Function Name:	RSingleSelection::Validate( )
//
//  Description:		Validates the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RSingleSelection::Validate( )	const
	{
	RSelection::Validate( );
	TpsAssertIsObject( RSingleSelection, this );
	TpsAssert( m_pSelectedObject, "NULL selected object." );
	TpsAssertValid( m_pSelectedObject );
	}
Beispiel #6
0
// ****************************************************************************
//
//  Function Name:	RStandaloneDocument::CancelMultiUndo( )
//
//  Description:		Cancel a MultiUndo chain of actions
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RStandaloneDocument::CancelMultiUndo( )
	{
	TpsAssertIsObject( RMultiUndoManager, m_pUndoManager );
	RMultiUndoManager*		pMultiManager = (RMultiUndoManager*)m_pUndoManager;
	//	First, restore the Previous undo manager
	m_pUndoManager = pMultiManager->GetPreviousUndoManager( );
	delete pMultiManager;
	}
Beispiel #7
0
// ****************************************************************************
//
//  Function Name:	REditComponentAttributesAction::Validate( )
//
//  Description:		Validates the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void REditComponentAttributesAction::Validate( ) const
	{
	RAction::Validate( );
	TpsAssertIsObject( REditComponentAttributesAction, this );
	TpsAssertValid( m_pCurrentSelection );
	TpsAssertValid( m_pComponentDocument );
	TpsAssertValid( &m_OldComponentAttributes );
	}
Beispiel #8
0
// ****************************************************************************
//
//  Function Name:	RNewComponentAction::Validate( )
//
//  Description:		Validates the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
///
// ****************************************************************************
//
void RNewComponentAction::Validate( ) const
	{
	RAction::Validate( );
	TpsAssertIsObject( RNewComponentAction, this );
	if( m_pComponentDocument )
		TpsAssertValid( m_pComponentDocument );
	TpsAssertValid( m_pParentDocument );
	}
Beispiel #9
0
// ****************************************************************************
//
//  Function Name:	RGraphicInterfaceImp::SetData( )
//
//  Description:		Set this data into the object.
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RGraphicInterfaceImp::SetData( RComponentDataHolder* pHolder )
{
	if ( pHolder != NULL )
	{
		TpsAssertIsObject( RGraphicHolderImp, pHolder );
		RGraphicHolderImp* pGraphicHolder	= static_cast<RGraphicHolderImp*>( pHolder );
		m_pGraphic	= pGraphicHolder->GetGraphic( );
		m_pGraphicDocument->SetGraphic( m_pGraphic );
		m_pGraphic->SetMonochromeColor( pGraphicHolder->GetColor( ) );
	}
	else
	{
		m_pGraphic = NULL;
	}
}
Beispiel #10
0
// ****************************************************************************
//
//  Function Name:	RGraphicInterfaceImp::EditData( )
//
//  Description:		Edit the object
//
//  Returns:			nothing
//
//  Exceptions:		kMemory, kUnknownException
//
// ****************************************************************************
//
void	RGraphicInterfaceImp::EditData( )
{
	//	If there is a grapyhic, copy it to allow editing.
	//		This is necessary since EditGraphicAction WILL destroy the old graphic....
	m_pGraphic	= static_cast<RPsd3SingleGraphic*>( m_pGraphicDocument->GetGraphic( ) );
	if ( m_pGraphic )
	{
		TpsAssertIsObject( RPsd3SingleGraphic, m_pGraphicDocument->GetGraphic( ) );
		RPsd3SingleGraphic* pTmpGraphic = new RPsd3SingleGraphic( *m_pGraphic );
		m_pGraphicDocument->SetGraphic( pTmpGraphic );
	}

	REditGraphicAction	action( m_pGraphicDocument ); 
	action.Do( );
}
Beispiel #11
0
// ****************************************************************************
//
//  Function Name:	RGraphicInterfaceImp::GetData( )
//
//  Description:		Return the data from the object that this interface references.
//
//  Returns:			new RGraphicHolder (containing the data)
//
//  Exceptions:		kMemory, kUnknownException
//
// ****************************************************************************
//
RComponentDataHolder*	RGraphicInterfaceImp::GetData( BOOLEAN fRemove )
{
	RGraphic*	pGraphic	= m_pGraphicDocument->GetGraphic( );

	if ( pGraphic )
	{
		TpsAssertIsObject( RPsd3SingleGraphic, pGraphic );
		RPsd3SingleGraphic*	pPsd3SingleGraphic = static_cast<RPsd3SingleGraphic*>( pGraphic );
		
		if (fRemove)
		{
			ClearData() ;
		}

		return new RGraphicHolderImp( pGraphic, fRemove );
	}

	return NULL;
}
Beispiel #12
0
ASSERTNAME

#include "GraphicInterfaceImp.h"
#include "GraphicDocument.h"
#include "GraphicView.h"
#include "Psd3SingleGraphic.h"
#include "Psd3TimepieceGraphic.h"
#include "EditGraphicAction.h"
#include "PropertyAttribImp.h"
#include "ChangeColorAction.h"
#include "ChunkyStorage.h"
#include "Stream.h"

#include "MemoryMappedBuffer.h"
#include "DataInterface.h"

// ****************************************************************************
//
//  Function Name:	RGraphicHolderImp::RGraphicHolderImp( )
//
//  Description:		Constructor.
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
RGraphicHolderImp::RGraphicHolderImp( RGraphic* pGraphic, BOOLEAN fOwnData )
{
	TpsAssertIsObject( RPsd3SingleGraphic, pGraphic );
	RPsd3SingleGraphic*	pPsd3SingleGraphic = static_cast<RPsd3SingleGraphic*>( pGraphic );
	m_Color = pGraphic->GetMonochromeColor( );

	if (fOwnData)
	{
		m_pGraphic = pPsd3SingleGraphic ; 
	}
	else
	{
		m_pGraphic	= new RPsd3SingleGraphic( *pPsd3SingleGraphic );
	}
}
Beispiel #13
0
// ****************************************************************************
//
//  Function Name:	RStandaloneDocument::EndMultiUndo( )
//
//  Description:		End a MultiUndo chain of actions
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RStandaloneDocument::EndMultiUndo( uWORD uwUndoStringId, uWORD uwRedoStringId )
	{
	TpsAssertIsObject( RMultiUndoManager, m_pUndoManager );
	RMultiUndoManager*		pMultiManager = (RMultiUndoManager*)m_pUndoManager;
	//	First, restore the Previous undo manager
	m_pUndoManager = pMultiManager->GetPreviousUndoManager( );

	//	Create a multi-undo action iff the pMultiManager has undo actions
	//	If an error occurs somewhere, we may have a multi undo with no actions
	//		in which case, we don't want to do anything...
	if (pMultiManager->CountUndoableActions() > 0)
		{
		//	Create the MultiUndo action and restore the undo manager to the previous manager
		RMultiUndoableAction*	pAction		= new RMultiUndoableAction( pMultiManager, uwUndoStringId, uwRedoStringId );
		//	Now Send the action to the document
		SendAction( pAction );
		}
	else
		delete pMultiManager;
	}
Beispiel #14
0
// ****************************************************************************
//
//  Function Name:	RBreakGroupAction::RBreakGroupAction( )
//
//  Description:		Constructor
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
RBreakGroupAction::RBreakGroupAction( RCompositeSelection* pCurrentSelection )
	: RUndoableAction( m_ActionId, STRING_UNDO_BREAKGROUP, STRING_REDO_BREAKGROUP ),
	  m_pCurrentSelection( pCurrentSelection ),
	  m_OldSelection( *pCurrentSelection )
	{
	// Validate parameters
	TpsAssertValid( pCurrentSelection );
	TpsAssert( m_pCurrentSelection->Count( ) == 1, "Break Group action only operates on one object." );
	TpsAssertIsObject( RComponentDocument, ( *m_pCurrentSelection->Start( ) )->GetRDocument( ) );

	m_pGroupDocument = static_cast<RComponentDocument*>( ( *m_pCurrentSelection->Start( ) )->GetRDocument( ) );
	TpsAssert( m_pGroupDocument->GetComponentType( ) == kGroupComponent, "Not a group." );

	// Get the parent document
	m_pParentDocument = pCurrentSelection->GetView( )->GetRDocument( );

	// Get the bounding rect of the group
	YSelectionBoundingRect boundingRect;
	pCurrentSelection->GetSelectionBoundingRect( boundingRect );
	m_GroupBoundingRect = boundingRect.m_TransformedBoundingRect;
	}
Beispiel #15
0
// ****************************************************************************
//
//  Function Name:	RHLSpellCheckInterface::RHLSpellCheckInterface()
//
//  Description:		Replace the current word with the given replacement
//
//  Returns:			TRUE if sucessful
//
//  Exceptions:		None
//
// ****************************************************************************
BOOLEAN RHLSpellCheckInterface::ReplaceWord( const RMBCString& original, const RMBCString& replacement )
{
	RMBCString				newText;
	RMBCStringIterator	iterator		= m_Text.Start( );
	RMBCStringIterator	iteratorEnd	= m_Text.End( );

	//	Empty the new string ( just to be paranoid );
	newText.Empty( );

	//	Copy the text before the word
	int	nLength = 0;
	while ( nLength++ < m_nWordStart )
	{
		newText	+= (*iterator);
		++iterator;
	}

	//	add the replacement word
	newText	+= replacement;
	//	skip over the original word
	iterator	+= original.GetStringLength( );

	//	add the remaining string
	while ( iterator != iteratorEnd )
	{
		newText	+= (*iterator);
		++iterator;
	}

	m_pDocument->SetHeadlineText( newText );
	m_Text			=	newText;
	m_nWordEnd		=	m_nWordStart + replacement.GetStringLength();

	//	Invalidate the render cache
	TpsAssertIsObject( RComponentView, m_pDocument->GetActiveView( ) );
	RComponentView* pView = static_cast< RComponentView* >( m_pDocument->GetActiveView( ) );
	pView->InvalidateRenderCache( );
	return TRUE;
}
Beispiel #16
0
// ****************************************************************************
//
//  Function Name:	RPathInterfaceImp::CreateInterface( )
//
//  Description:		Constructor function.
//
//  Returns:			new RInterface
//
//  Exceptions:		kMemory
//
// ****************************************************************************
//
RInterface* RPathObjectPropertiesImp::CreateInterface( const RComponentView* pView )
{
	TpsAssertIsObject( RPathView, pView );
	return new RPathObjectPropertiesImp( static_cast<const RPathView*>( pView ) );
}
Beispiel #17
0
// ****************************************************************************
//
//  Function Name:	RCutSelectionAction::Validate( )
//
//  Description:		Validates the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RCutSelectionAction::Validate( ) const
	{
	RDeleteSelectionAction::Validate( );
	TpsAssertIsObject( RCutSelectionAction, this );
	}
Beispiel #18
0
// ****************************************************************************
//
//  Function Name:	RCopySelectionAction::Validate( )
//
//  Description:		Validates the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RCopySelectionAction::Validate( ) const
	{
	RAction::Validate( );
	TpsAssertIsObject( RCopySelectionAction, this );
	}
Beispiel #19
0
// ****************************************************************************
//
//  Function Name:	RImageApplication::Validate( )
//
//  Description:		Validate the object
//
//  Returns:			Nothing.
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RImageApplication::Validate() const
{
	RComponentApplication::Validate();
	TpsAssertIsObject(RImageApplication, this);
}
Beispiel #20
0
// ****************************************************************************
//
//  Function Name:	RGroupDocument::Validate( )
//
//  Description:		Validate the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RGroupDocument::Validate( ) const
	{
	RComponentDocument::Validate( );
	TpsAssertIsObject( RGroupDocument, this );
	}
Beispiel #21
0
// ****************************************************************************
//
// Function Name:		RChunkBackstore::Validate( )
//
// Description:		Validates the object
//
// Returns:				nothing
//
// Exceptions:			None
//
// ****************************************************************************
//
void RChunkBackstore::Validate( ) const
	{
	RObject::Validate( );
	TpsAssertIsObject( RChunkBackstore, this );
	}
Beispiel #22
0
// ****************************************************************************
//
//  Function Name:	RMergeEntry::Validate( )
//
//  Description:		Validates the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RMergeEntry::Validate( ) const
	{
	RObject::Validate( );
	TpsAssertIsObject( RMergeEntry, this );
	}
Beispiel #23
0
// ****************************************************************************
//
//  Function Name:	RPathView::Validate( )
//
//  Description:		Validate the object.
//							
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RPathView::Validate( ) const
	{
	RComponentView::Validate( );
	TpsAssertIsObject( RPathView, this );
	}
Beispiel #24
0
// ****************************************************************************
//
// Function Name:		RScript::Validate( )
//
// Description:		Validates the object
//
// Returns:				nothing
//
// Exceptions:			None
//
// ****************************************************************************
//
void RScript::Validate( ) const
	{
	RObject::Validate( );
	TpsAssertIsObject( RScript, this );
	}
Beispiel #25
0
// ****************************************************************************
//
//  Function Name:	RStandaloneDocument::Validate( )
//
//  Description:		Validate the Document
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RStandaloneDocument::Validate( ) const
	{
	RDocument::Validate();
	TpsAssertIsObject( RUndoManager, m_pUndoManager );
	}
Beispiel #26
0
// ****************************************************************************
//
//  Function Name:	RImageInterfaceImp::CreateInterface( )
//
//  Description:		Constructor function.
//
//  Returns:			new RInterface
//
//  Exceptions:		kMemory
//
// ****************************************************************************
//
RInterface* RImageInterfaceImp::CreateInterface(const RComponentView* pView)
{
	TpsAssertIsObject(RImageView, pView);
	return new RImageInterfaceImp(static_cast<const RImageView*>(pView));
}
Beispiel #27
0
// ****************************************************************************
//
//  Function Name:	RViewDrawingSurface::Validate( )
//
//  Description:		Validates the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RViewDrawingSurface::Validate( ) const
	{
	BaseDrawingSurface::Validate( );
	TpsAssertIsObject( RViewDrawingSurface, this );
	}
Beispiel #28
0
// ****************************************************************************
//
//  Function Name:	RFont::Validate( )
//
//  Description:		Validates the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RFont::Validate( ) const
	{
	RObject::Validate( );
	TpsAssertIsObject( RFont, this );
	}
Beispiel #29
0
// ****************************************************************************
//
//  Function Name:	RHexColorGrid::Validate( )
//
//  Description:	Validates the object
//
//  Returns:		Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RHexColorGrid::Validate( ) const
{
	RObject::Validate( );
	TpsAssertIsObject( RHexColorGrid, this );
}
Beispiel #30
0
// ****************************************************************************
//
//  Function Name:	RBreakGroupAction::Validate( )
//
//  Description:		Validates the object
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RBreakGroupAction::Validate( ) const
	{
	RAction::Validate( );
	TpsAssertIsObject( RBreakGroupAction, this );
	}