コード例 #1
0
ファイル: prpsgds.cpp プロジェクト: Amadiro/xara-cairo
BOOL GuidesPropertiesTab::BuildGuidelineList(Layer* pLayer)
{
	GuidelineList.DeleteAll();
	pPropertiesDlg->DeleteAllValues(_R(IDC_GUIDETAB_GUIDELINELIST));

	ERROR2IF(pLayer == NULL, FALSE,"pLayer is NULL");

	Node* pNode = pLayer->FindFirstChild(CC_RUNTIME_CLASS(NodeGuideline));
	while (pNode != NULL)
	{
		NodeGuideline* pGuideline = (NodeGuideline*) pNode;
		if (pGuideline->GetType() == GuideType)
		{
			GuidelineListItem* pItem = (GuidelineListItem*)GuidelineList.GetHead();
			while (pItem != NULL && (pItem->pGuideline->GetOrdinate() < pGuideline->GetOrdinate()))
				pItem = (GuidelineListItem*)GuidelineList.GetNext(pItem);

			GuidelineListItem* pNewItem = new GuidelineListItem(pGuideline);

			if (pNewItem != NULL)
			{
				if (pItem == NULL)
					GuidelineList.AddTail(pNewItem);
				else
					GuidelineList.InsertBefore(pItem,pNewItem);
			}
		}

		pNode = pNode->FindNext(CC_RUNTIME_CLASS(NodeGuideline));
	}

	return TRUE;
}
コード例 #2
0
ファイル: chapter.cpp プロジェクト: Amadiro/xara-cairo
XLONG Chapter::GetChapterDepth()
{
	XLONG Depth	= 0;

	// Loop through document tree calculating the logical coordinate offset for the
	// current chapter 	

//	Chapter *pChapter = Node::FindFirstChapter(FindOwnerDoc());
	Node* pNode = FindParent();
	ERROR2IF(!(pNode->IsNodeDocument()), 0, "Parent of Chapter is not NodeDocument");
	Chapter *pChapter = (Chapter*)pNode->FindFirstChild(CC_RUNTIME_CLASS(Chapter));

	ENSURE(pChapter != NULL, "Couldn't find first chapter in Chapter::GetChapterDepth");
	
	while ((pChapter != NULL) && (pChapter != this))
	{		
                                         				
		ENSURE(pChapter->IsKindOf(CC_RUNTIME_CLASS(Chapter)), 
				"Chapter's sibling is not a Chapter");

		const DocRect ChapRect = pChapter->GetPasteboardRect();
            
        // Accumulate logical offset
		Depth += ChapRect.Height();						
			
		pChapter = (Chapter *) pChapter->FindNext();
	}

	return Depth;
}
コード例 #3
0
ファイル: tooldlg.cpp プロジェクト: Amadiro/xara-cairo
void ToolbarDlg::DeleteSelectedBar()
{
	// we can't delete the control bank !!
   	if (!CanDeleteSelection())
		return;

	String_32 BarName;
	GetSelectedBarName(&BarName);

	// If nothing is selected, we can't do anything
	if (BarName == String_8(TEXT("")))
		return;
	
	// we can't delete the infoobar
	if (BarName == String_32(TEXT("Infobar")))
		return;

	DialogBarOp* pBar = DialogBarOp::FindDialogBarOp(BarName);

	ENSURE(pBar,"Cannot find named bar in TakeToolbarDetails");

	// If bar is of correct type then adjust its visibility according to the
	// check mark...
	if ( !( pBar->IsKindOf(CC_RUNTIME_CLASS(SystemBarOp)) ||
			pBar->IsKindOf(CC_RUNTIME_CLASS(InformationBarOp))
	       )
		)
	{
		pBar->Delete();
		pBar->End();
		ShowToolbarList();
	}
}
コード例 #4
0
ファイル: opnudge.cpp プロジェクト: vata/xarino
void OpNudge::PerformMergeProcessing()
{
    // Obtain a pointer to the operation history for the current document
    OperationHistory* pOpHist = &pOurDoc->GetOpHistory();

    // Ensure that we are the last operation added to the operation history
    // Note cannot be an ERROR2 cos this function cannot fail.
    ERROR3IF(pOpHist->FindLastOp() != this, "Last Op should be this op");

    // OK lets see if the operation performed before this was an OpNudge operation
    Operation* pPrevOp = pOpHist->FindPrevToLastOp();

    if (pPrevOp != NULL)   // Check if there was a previous op
    {

        if (IS_A(pPrevOp, OpNudge))
        {
            // Yes it was
            // We can merge this op with pPrevOp if they both apply to the same set of objects
            // This will be TRUE is their SelectionStates are the same.
            RestoreSelectionsAction* pRestoreSelAct = (RestoreSelectionsAction*)
                    GetUndoActionList()->FindActionOfClass(CC_RUNTIME_CLASS(RestoreSelectionsAction));
            ERROR3IF(pRestoreSelAct == NULL, "This op should have a RestoreSelectionsAction");
            SelectionState* ThisOpsSelection = pRestoreSelAct->GetSelState();

            pRestoreSelAct = (RestoreSelectionsAction*)
                             pPrevOp->GetUndoActionList()->FindActionOfClass(CC_RUNTIME_CLASS(RestoreSelectionsAction));
            ERROR3IF(pRestoreSelAct == NULL, "OpNudge op should have a RestoreSelectionsAction");
            SelectionState* LastOpsSelection = pRestoreSelAct->GetSelState();

            if ((*ThisOpsSelection) == (*LastOpsSelection))
            {

                // scan to see if either of these ops hides a node
                // if either do then we cannot merge them together
                // this can happen if perhaps the extending definitions
                // were changed by the nudge (sjk 27-7-00)
                if (DoesActionListHideNodes(pPrevOp) || DoesActionListHideNodes(this) )
                    return;

                // this op can be merged into the previous op, we simply need to combine the
                // TransformNodeActions
                TransformNodeAction* pTransNdAct = (TransformNodeAction*)
                                                   GetUndoActionList()->FindActionOfClass(CC_RUNTIME_CLASS(TransformNodeAction));
                ERROR3IF(pTransNdAct == NULL, "This op should have a TransformNodeAction");

                TransformNodeAction* pLastOpsTransNdAct = (TransformNodeAction*)
                        pPrevOp->GetUndoActionList()->FindActionOfClass(CC_RUNTIME_CLASS(TransformNodeAction));
                ERROR3IF(pLastOpsTransNdAct == NULL,"OpNudgeOp should have a TransformNodeAction");

                pLastOpsTransNdAct->CombineWith(pTransNdAct);

                // This op is no longer required, so let's vape it
                pOpHist->DeleteLastOp();
            }
        }
    }
    return;
}
コード例 #5
0
ファイル: bfxpixop.cpp プロジェクト: UIKit0/xara-xtreme
BOOL BfxPixelOp::SetAuxilliaryBitmaps(KernelBitmap * pProposed /*A*/, KernelBitmap * pCurrent /*B*/,
							  KernelBitmap * pOriginal /*T*/, INT32 Threshold, DWORD theColour)
{
	if (pProposed)
	{
		ERROR2IF( (pProposed->ActualBitmap==NULL) ,FALSE,"BfxPixelOp can't find OIL bitmap");
		ERROR3IF( (!(pProposed->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxPixelOp Oil layer inconsistency");
		
		BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pProposed->ActualBitmap))->BMInfo->bmiHeader);
		
		ERROR2IF( ((pBMI->biHeight != Height) || (pBMI->biWidth != Width) || (BPP && pBMI->biBitCount !=BPP)), FALSE,
			  "Incompatible bitmaps for BfxPixelOp::SetAuxilliaryBitmap");
		pA = (DWORD *)(void *)(((CWxBitmap *)(pProposed->ActualBitmap))->BMBytes);
	}
	else
	{
		pA = NULL;
	}

	if (pOriginal)
	{
		ERROR2IF( (pOriginal->ActualBitmap==NULL) ,FALSE,"BfxPixelOp can't find OIL bitmap");
		ERROR3IF( (!(pOriginal->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxPixelOp Oil layer inconsistency");
		
		BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pOriginal->ActualBitmap))->BMInfo->bmiHeader);
		
		ERROR2IF( ((pBMI->biHeight != Height) || (pBMI->biWidth != Width) || (BPP && pBMI->biBitCount !=BPP)), FALSE,
			  "Incompatible bitmaps for BfxPixelOp::SetAuxilliaryBitmap");
		pT = (DWORD *)(void *)(((CWxBitmap *)(pOriginal->ActualBitmap))->BMBytes);
	}
	else
	{
		pT = NULL;
	}

	if (pCurrent)
	{
		ERROR2IF( (pCurrent->ActualBitmap==NULL) ,FALSE,"BfxPixelOp can't find OIL bitmap");
		ERROR3IF( (!(pCurrent->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxPixelOp Oil layer inconsistency");
		
		BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pCurrent->ActualBitmap))->BMInfo->bmiHeader);
		
		ERROR2IF( ((pBMI->biHeight != Height) || (pBMI->biWidth != Width) || (BPP && pBMI->biBitCount !=BPP)), FALSE,
			  "Incompatible bitmaps for BfxPixelOp::SetAuxilliaryBitmap");
		pB = (DWORD *)(void *)(((CWxBitmap *)(pCurrent->ActualBitmap))->BMBytes);
	}
	else
	{
		pB = NULL;
	}

	
	Value = Threshold;
	Colour = theColour;
	return TRUE;
}
コード例 #6
0
ファイル: nodepostpro.cpp プロジェクト: UIKit0/xara-xtreme
BOOL NodeEffect::IsValidEffectAttr(NodeAttribute* pAttr) const
{
	CCRuntimeClass* pAttrType = pAttr->GetAttributeType();

	return (pAttr->IsATranspFill() ||
			pAttrType == CC_RUNTIME_CLASS(AttrTranspFillGeometry) || //->IsKindOf(CC_RUNTIME_CLASS(AttrTranspChange)) ||
			pAttrType == CC_RUNTIME_CLASS(AttrStrokeTransp) || //pAttr->IsKindOf(CC_RUNTIME_CLASS(AttrStrokeTranspChange)) ||
			pAttrType == CC_RUNTIME_CLASS(AttrTranspFillMapping)
			);
}
コード例 #7
0
ファイル: tooldlg.cpp プロジェクト: Amadiro/xara-cairo
BOOL ToolbarDlg::Init()
{
	BOOL InitOK;

	// Initialise the contents of the static InfoBarName variable here...
	String_16 Blobby(_R(IDS_INFOBARNAME));
	InfoBarName = Blobby;

	String_16 Noel(_R(IDS_CONTROLBANKNAME));
	ControlBankName = Noel;

	InitOK = RegisterOpDescriptor(
								0,	/* Tool ID */
								_R(IDS_TOOLBARS_DLG),
								CC_RUNTIME_CLASS(ToolbarDlg),
								OPTOKEN_TOOLBARDLG,
								ToolbarDlg::GetState,
								0,					/* help ID */
								0,  				/* bubble help ID _R(IDBBL_LAYERDLG), */
								_R(IDB_WINDOWTOOLBARS),	/* resource ID */
								0,					/* control ID */
								SYSTEMBAR_ILLEGAL,				// Bar ID
								FALSE,							// Recieve system messages
								FALSE,							// Smart duplicate operation
								TRUE,							// Clean operation
								0,								// No vertical counterpart
								_R(IDS_BARSINFO_ONE)				// String for one copy only
								
								)
			&& RegisterOpDescriptor(
								0,
								_R(IDS_TOOLBARNAME_DLG),
								CC_RUNTIME_CLASS(ToolnameDlg),
								OPTOKEN_TOOLBARNAMEDLG,
								ToolnameDlg::GetState,
								0,	/* help ID */
								0,  /* bubble help ID _R(IDBBL_LAYERDLG), */
								0	/* bitmap ID */
								)
			&& RegisterOpDescriptor(
								0,
								_R(IDS_CUSTOMIZE_BAR_DLG),
								CC_RUNTIME_CLASS(CustomizeBarDlg),
								OPTOKEN_CUSTOMIZEBARDLG,
								CustomizeBarDlg::GetState,
								0,	/* help ID */
								0,  /* bubble help ID _R(IDBBL_LAYERDLG), */
								0	/* bitmap ID */
								)

			;

	return (InitOK);
}
コード例 #8
0
ファイル: opretro.cpp プロジェクト: UIKit0/xara-xtreme
BOOL OpRetroFit::BuildUndo(NodePath* pPreviousNode, NodePath* pNewNode)
{
	// A few quick error checks
	ENSURE(pPreviousNode!=NULL, "Previous Node was NULL in RetroFit::BuildUndo()");
	ENSURE(pPreviousNode->IsKindOf(CC_RUNTIME_CLASS(NodePath)), "Previous Node not a path");

	ENSURE(pNewNode!=NULL, "New Node was NULL in RetroFit::BuildUndo()");
	ENSURE(pNewNode->IsKindOf(CC_RUNTIME_CLASS(NodePath)), "New Node not a path");

	// Falg to see if it has worked
	BOOL IsOperationOk = TRUE;

	// Start the undo of the selected item
	IsOperationOk = DoStartSelOp(FALSE);

	// Will the node allow this op to take place?
	ObjChangeFlags cFlags;
	cFlags.ReplaceNode = TRUE;
	ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,pPreviousNode,this);
	if (IsOperationOk)
		IsOperationOk = pPreviousNode->AllowOp(&ObjChange);
	
	// insert our new object
	if (IsOperationOk)
	{
		// Insert the new node into the tree
		IsOperationOk = DoInsertNewNode(pNewNode, pPreviousNode, NEXT, TRUE);
	}

	// Invalidate the region covered by the old node
	if (IsOperationOk)
		IsOperationOk = DoInvalidateNodeRegion(pPreviousNode, TRUE);

	// Make sure everything has worked
	if (IsOperationOk)
	{
		// Remove the old node
		IsOperationOk = DoHideNode(pPreviousNode, TRUE);
	}

	ObjChange.Define(OBJCHANGE_FINISHED,cFlags,pPreviousNode,this);
	IsOperationOk = UpdateChangedNodes(&ObjChange);

	// If something went wrong then fail
	if (!IsOperationOk)
		FailAndExecute();
	
	// End the operation properly
	End();

	// return a value back to the caller
	return IsOperationOk;
}
コード例 #9
0
ファイル: prnprefs.cpp プロジェクト: vata/xarino
BOOL PrintPrefsDlg::Init()
{
	BOOL InitOK;

	// Now register ourselves with the dialog system
	InitOK = RegisterOpDescriptor(
								0,								// Tool ID 
								_R(IDS_PRINTOPTIONS),				// String resource ID
								CC_RUNTIME_CLASS(PrintPrefsDlg),	// Runtime class
								OPTOKEN_PRINTOPTIONS, 			// Token string
								GetState,						// GetState function
								0,								// help ID
								0,  							// bubble help
								0,								// resource ID
								0,								// control ID
								SYSTEMBAR_ILLEGAL,				// Bar ID
								FALSE,							// Recieve system messages
								FALSE,							// Smart duplicate operation
								TRUE,							// Clean operation
								0,								// No vertical counterpart
								_R(IDS_PRINTPREFSDLG_ONE),			// String for one copy only error
								(DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC) // Auto state flags								);
								);

	// Now register ourselves with the dialog system for the units button on the windows
	// button bar as well
	InitOK = InitOK && RegisterOpDescriptor(
								0,								// Tool ID
								_R(IDS_PRINTOPTIONS),				// String resource ID
								CC_RUNTIME_CLASS(PrintTabPrintPrefsDlg),	// Runtime class
								OPTOKEN_PRINTOPTIONSDLG,		// Token string
								GetState,						// GetState function
								0,								// help ID
								0,  							// bubble help
								0,								// resource ID
								0,								// control ID
								SYSTEMBAR_ILLEGAL,				// Bar ID
								FALSE,							// Recieve system messages
								FALSE,							// Smart duplicate operation
								TRUE,							// Clean operation
								0,								// No vertical counterpart
								_R(IDS_PRINTPREFSDLG_ONE),			// String for one copy only error
								(DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC) // Auto state flags								);
								);

	// Options tabs and page sizes initialised by the applications options (AppPrefsDlg)
	// class.

	return (InitOK);
}
コード例 #10
0
ファイル: nodeattr.cpp プロジェクト: Amadiro/xara-cairo
BOOL NodeAttribute::CopyComponentData(BaseDocument* SrcDoc, BaseDocument* NodesDoc)
{
	// Ask the base class to copy its data
	if (!NodeRenderable::CopyComponentData(SrcDoc, NodesDoc))
	{
		return FALSE; // Failed
	}
	// Get the colour list component
	ColourListComponent *pComponent = 
		(ColourListComponent *) NodesDoc->GetDocComponent(CC_RUNTIME_CLASS(ColourListComponent));

	ENSURE (pComponent != NULL, "Could not find ColourListComponent");

	// Copy across all DocColours
	for (INT32 i=0;;i++)
	{
		DocColour* pDocCol = EnumerateColourFields(i); 
		if (pDocCol == NULL)
		{
			// there are no more colours to copy
			break;
		}
		// Copy the colour across 
		if (pComponent->CopyColourAcross(pDocCol) == CCCOPY_FAILED)
		{
			return FALSE; // Failed to copy colour info
		} 
	}
	return TRUE; 
}
コード例 #11
0
ファイル: tipsdlg.cpp プロジェクト: Amadiro/xara-cairo
/********************************************************************************************

>	BOOL TipsDlg::Init()

	Author:		Colin_Barfoot (Xara Group Ltd) <*****@*****.**>
	Created:	03/08/96
	Returns:	FALSE if initialization fails
	Purpose:	Completes the work of the constructor, but returning an error if complete
				construction was not possible.
	Errors:		-
	SeeAlso:	TipsDlg::TipsDlg()

********************************************************************************************/
BOOL TipsDlg::Init()
{  
	if (!RegisterOpDescriptor
	(
 		0,							// toolID
 		_R(IDS_TIPOFTHEDAYMENU),	// Text for Menu
		CC_RUNTIME_CLASS(TipsDlg),
 		OPTOKEN_TIPSDLG,			// Token to Invoke dialog
 		TipsDlg::GetState,			// GetState for menu disabling
 		0,							// HelpID
 		_R(IDS_BBL_TIPDLG),				// BubbleID
		0,							// ResourceID
 		0,							// BitmapID
 		SYSTEMBAR_ILLEGAL,			// Bar ID
		FALSE,						// Recieve system messages
		FALSE,						// Smart duplicate operation
		TRUE,						// Clean operation
		NULL,						// No vertical counterpart
		_R(IDS_BARSINFO_ONE)			// String for one copy only
	))
	{
		return FALSE;
	}

	if (!Camelot.DeclareSection(szSection, 2) ||
		!Camelot.DeclarePref(szSection, szIntNextID, &g_uNextID) ||
		!Camelot.DeclarePref(szSection, szIntStartup, &g_bStartUp)
	)
	{
		return FALSE;
	}
	return TRUE;
}
コード例 #12
0
ファイル: sgmenu.cpp プロジェクト: UIKit0/xara-xtreme
SuperGallery *OpGalleryCommand::GetGalleryAndCommand(OpDescriptor *pOpDesc, String_32 *Command)
{
	String_256 Temp = pOpDesc->Token;
	TCHAR *Str = (TCHAR *)Temp;

	*Command = TEXT("");

	while (*Str != '\0' && *Str != ':')
		Str++;

	if (*Str == '\0')
		return(NULL);

	// Copy the right end of the string into Command for return
	*Command = (TCHAR *) (Str+1);

	// Find the gallery referenced by the left end of the string
	*Str = '\0';		// NULL Terminate the left end of the string

	String_32 Bob;
	Temp.Left(&Bob, 31);
	SuperGallery* pSuperGallery = SuperGallery::FindSuperGallery(Bob , GalleryBarNameLimitSize);

	if (pSuperGallery != NULL && pSuperGallery->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)))
		return((SuperGallery *) pSuperGallery);

	// Not found, or isn't a gallery?! (eep!)
	return(NULL);
}
コード例 #13
0
ファイル: mkshapes.cpp プロジェクト: Amadiro/xara-cairo
/********************************************************************************************

>	void OpMakeNodesShapes::DoWithParam(OpDescriptor* pOp, OpParam* pParam)

	Author:		Karim_MacDonald (Xara Group Ltd) <*****@*****.**>
	Created:	23/11/1999
	Inputs:		pOp			unused pointer to an OpDescriptor.
				pParam		pointer to an OpParamMakeNodesShapes data information structure.

	Outputs:	The list of nodes, passed in through the OpParam, is converted in place
				into paths.
	Purpose:	This undoable operation converts a given list of nodes to editable shapes
				(paths), each new node retaining the selection status of the original.
	See also:	OpParamMakeNodesShapes

********************************************************************************************/
void OpMakeNodesShapes::DoWithParam(OpDescriptor* pOp, OpParam* pParam)
{
	std::list<Node*>* plpNodes = ((OpParamMakeNodesShapes*)pParam)->m_plpNodes;

	Node* pNode;
	BOOL bFirst = FALSE;
	BOOL ok = TRUE;
	for (	std::list<Node*>::iterator iterNode = plpNodes->begin();
			iterNode != plpNodes->end() && ok;
			iterNode++ )
	{
		pNode = *iterNode;
		BecomeA baInfo(BECOMEA_REPLACE, CC_RUNTIME_CLASS(NodePath), this,
											pNode->IsSelected(), bFirst);
		baInfo.SetResultsStayInPlace(TRUE);
		ok = pNode->DoBecomeA(&baInfo);

#ifdef _DEBUG
		if (ok)
			TRACEUSER( "Karim", _T("converted %s to editable shapes\n"), pNode->Name());
#endif

		bFirst = TRUE;
	}

	if (!ok)
	{
		InformError();
		FailAndExecute();
	}

	End();
	return;
}
コード例 #14
0
ファイル: doccoord.cpp プロジェクト: Amadiro/xara-cairo
WorkCoord DocCoord::ToWork( Spread *pSpread, View *pView)
{
	WorkCoord 	WrkPoint(MakeXLong(this->x), MakeXLong(this->y));
	DocCoord	ChapterPos;				// To hold the top-left of the found chapter
	XLONG		ChapterDepth;			// To hold the accumulated depth of the chapter
	XMatrix		ConvertToWorkMat;		// Transformation matrix
	
	Chapter *pChapter = (Chapter *) pSpread->FindParent();
	ENSURE(pChapter->IsKindOf(CC_RUNTIME_CLASS(Chapter)), "Spread's parent is not a chapter");


	// Find top left of chapter pasteboard
	DocRect ChapterRect = pChapter->GetPasteboardRect(TRUE, pView);
	ChapterPos.x = ChapterRect.lo.x;
	ChapterPos.y = ChapterRect.hi.y;

	// Find chapter depth
	ChapterDepth = pChapter->GetChapterDepth();
	
	// This builds the 64-bit conversion matrix needed for Document To WorkArea 
	// coordinate mappings.

	ConvertToWorkMat = ComposeDocToWorkXMat(ChapterPos, 
											ChapterDepth,
											pView->GetViewScale());
	
	// Apply the matrix to the DocCoord...
	ConvertToWorkMat.transform(&WrkPoint, 1);

	return (WrkPoint);
}
コード例 #15
0
ファイル: eliptool.cpp プロジェクト: Amadiro/xara-cairo
/********************************************************************************************

>	BOOL EllipseTool::Init()

	Author:		Peter_Arnold (Xara Group Ltd) <*****@*****.**>
	Created:	18/03/95
	Inputs:		-
	Outputs:	-
	Returns:	TRUE/FALSE for success/failure
	Purpose:	Called to initialise the ellipse tool.
	Errors:		-
	SeeAlso:	QuickShapeBase::Init

********************************************************************************************/
BOOL EllipseTool::Init()
{
	BOOL ok = TRUE;

	pQuickShapeBaseInfoBarOp = new QuickShapeBaseInfoBarOp(this, _R(IDD_ELLIPSETOOLBAR));
	return pQuickShapeBaseInfoBarOp != NULL;

PORTNOTE("dialog", "Removed Bar reading")
#if 0
	CCResTextFile file;									// Resource File
	QuickShapeBaseInfoBarOpCreate BarCreate;			// Object that creates QuickShapeBaseInfoBarOp objects

	 		ok = file.open(_R(IDM_ELLIPSE_BAR), _R(IDT_INFO_BAR_RES));	// Open resource
	if (ok) ok = DialogBarOp::ReadBarsFromFile(file,BarCreate);	// Read and create info bar
	if (ok) file.close();									 	// Close resource

	ERROR2IF(!ok,FALSE,"Unable to load EllipseTool.ini from resource"); 

	// Info bar now exists.  Now get a pointer to it
	String_32 str = String_32(_R(IDS_ELIPTOOL_INFOBARNAME));
	DialogBarOp* pDialogBarOp = DialogBarOp::FindDialogBarOp(str);
	
	ERROR2IF(pDialogBarOp==NULL, FALSE, "Ellipse infobar not found\n");

	ok = pDialogBarOp->IsKindOf(CC_RUNTIME_CLASS(QuickShapeBaseInfoBarOp));
	if (ok)
	{
		pQuickShapeBaseInfoBarOp = (QuickShapeBaseInfoBarOp*)pDialogBarOp;
		pQuickShapeBaseInfoBarOp->pQuickShapeBase = this;
	}
#endif
	ERROR2IF(!ok,FALSE,"Error finding the Ellipse tool info bar");

	return (ok);
}
コード例 #16
0
ファイル: plugopun.cpp プロジェクト: Amadiro/xara-cairo
ActionCode ActionApplyPlugInToBitmap::Init( Operation* const pOp, 
											ActionList* pActionList, 	
						  					UINT32 ActionSize,
											Document *pDocument,
											KernelBitmap *pBitmap,
											KernelBitmapRef *pBitmapRef,
											NodeBitmap * pFoundNode,
											AttrFillGeometry * pFoundFillAttribute,
				  							Action** NewAction,
											BOOL bUpdateAspect)
{
	ActionCode Ac = (Action::Init(pOp,
									pActionList,
									ActionSize,
									CC_RUNTIME_CLASS(ActionApplyPlugInToBitmap), 
									NewAction));
	if (*NewAction != NULL)
	{
		ActionApplyPlugInToBitmap *ACC = (ActionApplyPlugInToBitmap*) (*NewAction);
		ACC->m_pDocument  = pDocument;
		ACC->m_pBitmap  = pBitmap;
		ACC->m_pBitmapRef = pBitmapRef;
		ACC->m_pFoundNode = pFoundNode;
		ACC->m_pFoundFillAttribute = pFoundFillAttribute;
		ACC->m_bUpdateAspect = bUpdateAspect;
	}

	return (Ac);
}
コード例 #17
0
ファイル: aligndlg.cpp プロジェクト: Amadiro/xara-cairo
BOOL ArrangeAlignment::Init()
{
	// init array holding coords of diagram rects on dialog in all alignments
	ArrangeAlignment::CalcDiagramRectsOneAxis(ArrangeAlignment::DiagRectX,DiagRectWidth,
		DiagRectOrderX,DiagRectGapX,DiagWidth-1);
	ArrangeAlignment::CalcDiagramRectsOneAxis(ArrangeAlignment::DiagRectY,DiagRectHeight,
		DiagRectOrderY,DiagRectGapY,DiagHeight-1);

	return RegisterOpDescriptor(
		0,									// Tool ID
 		_R(IDS_ARRANGE_ALIGNMENT),			// String resource ID
		CC_RUNTIME_CLASS(ArrangeAlignment),	// Runtime class
 		OPTOKEN_ALIGNDLG,					// Token string
 		ArrangeAlignment::GetState,			// GetState function
		0,									// Help ID
		_R(IDBBL_ALIGNEMENT),					// Bubble ID
		_R(IDD_BARCONTROLSTORE),				// Resource ID
		_R(IDC_ALIGNEMENT),						// Control ID
		SYSTEMBAR_EDIT,						// Bar ID
		TRUE,								// Recieve system messages
		FALSE,								// Smart duplicate operation
		TRUE,								// Clean operation
		0,									// No vertical counterpart
		_R(IDS_ARRANGEALIGNMENT_ONE),			// String for one copy only
		(DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC) // Auto state flags
	);
}   
コード例 #18
0
ファイル: prpsgds.cpp プロジェクト: Amadiro/xara-cairo
ActionCode LayerColourAction::Init(	UndoableOperation* pOp,
									ActionList* pActionList,
									OpChangeLayerColourParam EntryParam)
{
	UINT32 ActSize = sizeof(LayerColourAction);

	LayerColourAction* pNewAction;
	ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(LayerColourAction),(Action**)&pNewAction);

	if (Ac != AC_FAIL && pNewAction != NULL)
	{
		OpChangeLayerColourParam& Param = ((LayerColourAction*)pNewAction)->Param;

		Document* pDoc 	 = EntryParam.pDoc;
		Layer*    pLayer = EntryParam.pLayer;

		Param.pDoc 	 = pDoc;
		Param.pLayer = pLayer;

		if (pDoc != NULL && pLayer != NULL)
		{
			DocColour* pDocColour = pLayer->GetGuideColour();
			Param.pColour = pDocColour->FindParentIndexedColour();

			pLayer->SetGuideColour(EntryParam.pColour);
			LayerSGallery::ForceRedrawLayer(pDoc,pLayer);
			BROADCAST_TO_ALL(LayerMsg(pLayer,LayerMsg::GUIDELINES_CHANGED));
		}

		ERROR3IF(pDoc == NULL,  "pDoc is NULL");			
		ERROR3IF(pLayer == NULL,"pLayer is NULL");			
	}

	return Ac;
}
コード例 #19
0
ファイル: gbrush.cpp プロジェクト: UIKit0/xara-xtreme
BOOL GBrush::InitGBrush(BOOL FirstTime)
{
	if (FirstTime && Camelot.DeclareSection( wxT("Screen"), 10))
	{
		Camelot.DeclarePref(NULL, wxT("BetterBrushes"), &WantBetterBrushes, FALSE, TRUE );
	}
	// Register the (debug) Op to enable/disable GBrush
	if (!Operation::RegisterOpDescriptor(
						0,
						_R(IDS_GBRUSH),
						CC_RUNTIME_CLASS(OpGBrush),
						OPTOKEN_GBRUSH,
						OpGBrush::GetState,
						0,	/* help ID */
						0, //_R(IDBBL_ANTIALIASOP),
						0	/* bitmap ID */
						))
	{
		TRACE( wxT("RegisterOpDescriptor( OpGBrush ) failed") );
		return FALSE;
	}

	// Ensure that none of the GBrushes are active
	NewBrushState();
	Current = NULL;

	return TRUE;
}
コード例 #20
0
ファイル: bfxpixop.cpp プロジェクト: UIKit0/xara-xtreme
BOOL BfxPixelOpPseudo::SetBitmap(KernelBitmap * pKB, DWORD theCacheStateMask, DWORD theCacheValueMask,
								  BOOL theDefaultValue)
{
	Base = NULL;
	ERROR2IF( ((!pKB) || (pKB->ActualBitmap==NULL)) ,FALSE,"BfxALU can't find OIL bitmap");
	ERROR3IF( (!(pKB->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxALU Oil layer inconsistency");

	BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pKB->ActualBitmap))->BMInfo->bmiHeader);

	BPP=pBMI->biBitCount;
	ERROR2IF(BPP>8, FALSE,"Pseudo colour BMP not pseudo colour");
	switch (BPP)
	{
		case 1 : Log2BPP=0; break;
		case 2 : Log2BPP=1; break;
		case 4 : Log2BPP=2; break;
		case 8 : Log2BPP=3; break;
		default:
		ERROR2(FALSE, "Invalid BPP field");
	}

	if (!BfxPixelOp::SetBitmap(pKB, theCacheStateMask,theCacheValueMask, theDefaultValue)) return FALSE;

	BPPMask = (BPP==32)?0xFFFFFFFF:(1<<BPP)-1;
	XShift = 3-Log2BPP;
	XMask = (1<<XShift)-1;
	Size = (pBMI->biSizeImage<<3)>>Log2BPP;

	return TRUE;
}
コード例 #21
0
ファイル: bfxpixop.cpp プロジェクト: UIKit0/xara-xtreme
BOOL BfxPixelOp::SetBitmap(KernelBitmap * pKB, DWORD theCacheStateMask, DWORD theCacheValueMask,
								  BOOL theDefaultValue)
{
	Base = NULL;
	ERROR2IF( ((!pKB) || (pKB->ActualBitmap==NULL)) ,FALSE,"BfxALU can't find OIL bitmap");
	ERROR3IF( (!(pKB->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxALU Oil layer inconsistency");

	BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pKB->ActualBitmap))->BMInfo->bmiHeader);

	ERROR2IF( (BPP && pBMI->biBitCount != BPP), FALSE, "BfxPixelOp called with incorrect BPP");

	Base = (DWORD *)(void *)(((CWxBitmap *)(pKB->ActualBitmap))->BMBytes);
	Width = pBMI->biWidth;
	INT32 Bits = pBMI->biBitCount;
	switch (Bits)
	{
		case 1 : WidthRounded = (Width+31) &~31; break;
		case 2 : WidthRounded = (Width+15) &~15; break;
		case 4 : WidthRounded = (Width+7) &~7; break;
		case 8 : WidthRounded = (Width+3) &~3; break;
		case 16: WidthRounded = (Width+1) &~1; break;
		case 32:
		default:
				 WidthRounded = Width; break;
	}

 	Height = pBMI->biHeight;
	Size = (pBMI->biSizeImage)>>2;

	return TRUE;
}
コード例 #22
0
ファイル: bfxpixop.cpp プロジェクト: UIKit0/xara-xtreme
void BfxPixelOpPseudo::TranslateToRGB(DWORD Colour, KernelBitmap * pKB,
											   INT32 * R, INT32 * G, INT32 * B)
{
	RGBQUAD Col;

	if ((!pKB) || (pKB->ActualBitmap==NULL))
	{
		ERROR3( "BfxALU can't find OIL bitmap");
		return;
	}
	ERROR3IF( (!(pKB->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxALU Oil layer inconsistency");

	BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pKB->ActualBitmap))->BMInfo->bmiHeader);

	if ( Colour >= pBMI->biClrUsed )
	{
		ERROR3("Too large palette entry");
		*R=*G=*B=0;
		return;
	}

	Col = ((RGBQUAD *)(pBMI+1/*pointer arith*/))[Colour];	
	
	*R = Col.rgbRed;
	*G = Col.rgbGreen;
	*B = Col.rgbBlue;
	return;
};
コード例 #23
0
ファイル: princomp.cpp プロジェクト: Amadiro/xara-cairo
BOOL PrintComponentClass::AddComponent(BaseDocument *pDocument)
{
	// Check to see if this document already has a print component; if so, leave it alone.
	if (pDocument->GetDocComponent(CC_RUNTIME_CLASS(PrintComponent)) != NULL)
		return TRUE;

	// No print component- try to create a new one for this document.

	// Firstly, create a new PrintControl object for the print component
	PrintControl *pPrCtrl = new PrintControl();
	if(pPrCtrl == NULL)
		return FALSE;

	// Ok - create the print component using this print control object.
	PrintComponent *pComponent = new PrintComponent(pPrCtrl);
	if (pComponent == NULL)
	{
		// Out of memory...
		delete pPrCtrl;
		return FALSE;
	}

	// All ok - add the component to the document.
	pDocument->AddDocComponent(pComponent);

	return TRUE;
}
コード例 #24
0
ファイル: nativeop.cpp プロジェクト: vata/xarino
BOOL OpSaveAsNativeV1::Init()
{
	BOOL InitOK = TRUE;

	// Register the save as web op desciptor
	InitOK = RegisterOpDescriptor(
									0, 							// Tool ID
									_R(IDS_SAVEASNATIVEV1),			// String resource ID
									CC_RUNTIME_CLASS(OpSaveAsNativeV1), 	// Runtime class
									OPTOKEN_SAVEASNATIVEV1,		// Token string
									GetState,					// GetState function
									0,							// help ID
									_R(IDBBL_SAVEASNATIVEV1),		// bubble help
									0, //_R(IDD_BARCONTROLSTORE),		// resource ID
									0, //_R(IDC_FILESAVETEMPLATE),		// control ID
									SYSTEMBAR_ILLEGAL,			// Bar ID
									TRUE,						// Recieve system messages
									FALSE,						// Smart duplicate operation
									TRUE,						// Clean operation
									0,							// No vertical counterpart
									0,							// String for one copy only error
									(DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC) // Auto state flags
 								);
	if (!InitOK) return FALSE; 

	// All worked
	return TRUE;
}
コード例 #25
0
ファイル: pathops.cpp プロジェクト: UIKit0/xara-xtreme
/********************************************************************************************
>	static BOOL	OpMenuSelectPathPoints::Init()

	Author:		Peter_Arnold (Xara Group Ltd) <*****@*****.**>
	Created:	30/04/95
	Inputs:		-
	Outputs:	-
	Returns:	TRUE/FALSE for success/failure
	Purpose:	Initialises the two path select points operations
	SeeAlso:	OpSelectAllPathPoints, OpDeSelectAllPathPoints
********************************************************************************************/
BOOL OpMenuSelectPathPoints::Init()	
{
	BOOL ok = RegisterOpDescriptor(	0, 
									_R(IDS_SELECTALLPATHPOINTS),
									CC_RUNTIME_CLASS(OpSelectAllPathPoints), 
									OPTOKEN_SELECTALLPATHPOINTS,
									OpMenuSelectPathPoints::GetState);

	if (ok)
		ok = RegisterOpDescriptor(	0, 
									_R(IDS_DESELECTALLPATHPOINTS),
									CC_RUNTIME_CLASS(OpDeSelectAllPathPoints), 
									OPTOKEN_DESELECTALLPATHPOINTS,
									OpMenuSelectPathPoints::GetState);

	return ok;
}
コード例 #26
0
ファイル: stdbars.cpp プロジェクト: vata/xarino
void StandardBar::BroadcastClose(OpDescriptor* pOpDesc)
{
	if (MessageHandler::MessageHandlerExists(CC_RUNTIME_CLASS(StandardBar)))
	{
		// Send all message handlers of our class a message
		// For some reason we have to send it to all DialogOps - apparently we can't broadcast to a subclass
		BROADCAST_TO_CLASS(StandardBarMsg(pOpDesc, StandardBarMsg::CLOSE), DialogOp);
	}
}
コード例 #27
0
ファイル: tooldlg.cpp プロジェクト: Amadiro/xara-cairo
void ToolbarDlg::NewToolbar()
{
	// Invoke the new toolbar name operation
	// Obtain a pointer to the op descriptor for the new toolbar name operation
	OpDescriptor* pOpDesc =
		OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(ToolnameDlg));
	ENSURE(pOpDesc,"Can't find ToolnameDlg Op.");
	// Invoke the operation.
	pOpDesc->Invoke();
}
コード例 #28
0
ファイル: brshname.cpp プロジェクト: UIKit0/xara-xtreme
BOOL CInitBrushNameDlg::Init()
{  
	return RegisterOpDescriptor(0,
								_R(IDS_OK),
								CC_RUNTIME_CLASS(CInitBrushNameDlg),
								OPTOKEN_INITNAME_BRUSH_DLG,
								CInitBrushNameDlg::GetState,
								0,								// help ID
								0);								// bubble ID
}   
コード例 #29
0
ファイル: nativeop.cpp プロジェクト: vata/xarino
BOOL OpMenuLoad::Init()
{
	// Register this operations descriptor
	return RegisterOpDescriptor(0, _R(IDT_IMPORT), CC_RUNTIME_CLASS(OpMenuLoad),
								OPTOKEN_NATIVELOAD, GetState,
								0, _R(IDBBL_IMPORTFILEOP), 0,0,SYSTEMBAR_ILLEGAL,
								TRUE, FALSE, TRUE);

	return false;
}
コード例 #30
0
ファイル: exceptio.cpp プロジェクト: vata/xarino
BOOL OpException::Init()
{

	OpDescriptor *OpEx[4];
	
	OpEx[0] = new OpDescriptor(	0,
							_R(IDM_CRASHME_PTR),
							CC_RUNTIME_CLASS(OpException),
							OPTOKEN_EXCEPTION_PTR,
							OpException::GetState
											);

	OpEx[1] = new OpDescriptor(
							0,
							_R(IDM_CRASHME_INT),
							CC_RUNTIME_CLASS(OpException),
							OPTOKEN_EXCEPTION_INT,
							OpException::GetState
											);

	OpEx[2] = new OpDescriptor( 
							0,
							_R(IDM_CRASHME_DBL),
							CC_RUNTIME_CLASS(OpException),
							OPTOKEN_EXCEPTION_DBL,
							OpException::GetState
											);

	OpEx[3] = new OpDescriptor( 
							0,
							_R(IDM_CRASHME_REN),
							CC_RUNTIME_CLASS(OpException),
							OPTOKEN_EXCEPTION_REN,
							OpException::GetState
											);


	if (!( OpEx[0] && OpEx[1] && OpEx[2] && OpEx[3]))
		return FALSE;

	return TRUE;
}