本文整理汇总了C++中CC_RUNTIME_CLASS函数的典型用法代码示例。如果您正苦于以下问题:C++ CC_RUNTIME_CLASS函数的具体用法?C++ CC_RUNTIME_CLASS怎么用?C++ CC_RUNTIME_CLASS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CC_RUNTIME_CLASS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ERROR2IF
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: FindParent
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: GetSelectedBarName
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: ERROR3IF
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: ERROR2IF
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: return
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: Blobby
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: ENSURE
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: RegisterOpDescriptor
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: CopyComponentData
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: Colin_Barfoot
/********************************************************************************************
> BOOL TipsDlg::Init()
Author: Colin_Barfoot (Xara Group Ltd) <[email protected]>
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: while
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: Karim_MacDonald
/********************************************************************************************
> void OpMakeNodesShapes::DoWithParam(OpDescriptor* pOp, OpParam* pParam)
Author: Karim_MacDonald (Xara Group Ltd) <[email protected]>
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: WrkPoint
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: Peter_Arnold
/********************************************************************************************
> BOOL EllipseTool::Init()
Author: Peter_Arnold (Xara Group Ltd) <[email protected]>
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);
}