#include <bfxop.h>
Inheritance diagram for BfxPlugInContextMenu:
Public Member Functions | |
BfxPlugInContextMenu (KernelBitmap *pBitmap, Document *pDocument) | |
Default constructer. | |
virtual BOOL | Build () |
To build the Bfx plug-ins pop-up menu. | |
Static Public Member Functions | |
static BOOL | BuildMenu (KernelBitmap *pBitmap, Document *pDocument, ContextMenu *pContextMenu, MenuItem *pMainRoot=NULL, BOOL AddSeparator=FALSE, BOOL UseUndoable=FALSE) |
To build the a Bfx plug-ins pop-up menu either directly or tacked on as a sub-menu item to the specified pMainRoot. | |
Protected Attributes | |
KernelBitmap * | m_pBitmap |
Document * | m_pDocument |
Private Member Functions | |
CC_DECLARE_MEMDUMP (BfxPlugInContextMenu) |
Definition at line 155 of file bfxop.h.
|
Default constructer.
Definition at line 376 of file bfxop.cpp. 00377 { 00378 BfxPlugInOp::SetBitmapAndDocument(pBitmap, pDocument); 00379 00380 // remember them for later use 00381 m_pBitmap = pBitmap; 00382 m_pDocument = pDocument; 00383 00384 }
|
|
To build the Bfx plug-ins pop-up menu.
Reimplemented from PlugInsContextMenu. Definition at line 398 of file bfxop.cpp. 00399 { 00400 return BfxPlugInContextMenu::BuildMenu(m_pBitmap, m_pDocument, this); 00401 }
|
|
To build the a Bfx plug-ins pop-up menu either directly or tacked on as a sub-menu item to the specified pMainRoot.
Reimplemented from PlugInsContextMenu. Definition at line 425 of file bfxop.cpp. 00428 { 00429 ERROR2IF(pContextMenu == NULL,FALSE,"BfxPlugInContextMenu::BuildMenu null ContextMenu to add to"); 00430 00431 // Inform the Bfx operation what bitmap and document it will be working on 00432 BfxPlugInOp::SetBitmapAndDocument(pBitmap, pDocument); 00433 00434 BOOL ok = TRUE; 00435 // In the non-undoable case we require the bitmap and document pointers. 00436 // In the undoable case these will be null. 00437 if ((pBitmap != NULL && pDocument != NULL) || UseUndoable) 00438 { 00439 //ok = ok && pContextMenu->BuildCommand(OPTOKEN_Bfx_APPLYLAST, TRUE, pMainRoot); 00440 00441 PlugInManager* pManager = GetApplication()->GetPlugInManager(); 00442 if (pManager != NULL) 00443 { 00444 String_32 OpToken; 00445 String_32 FamilyOpToken; 00446 String_32 LastFamilyOpToken; 00447 MenuItem* pFamilyRoot = NULL; 00448 // Add the unique undo signature 00449 String_32 UndoSig(TEXT(PLUGIN_UNDO_SIG)); 00450 // Go through the list of plug-ins registered to the system and make up a 00451 // menu structure from the OpTokens that they have registered. 00452 // Assumes the plug-ins are sorted correctly on family names and then 00453 // plug-in names. 00454 PlugInItem * pPlugIn = pManager->GetFirstPlugIn(); 00455 while (pPlugIn) 00456 { 00457 // Only allow Bfx plug-ins on this menu. We are very plug-inist! 00458 if (pPlugIn->GetTypeOfPlugIn() == PLUGIN_BFX) 00459 { 00460 OpToken = pPlugIn->GetUniqueID(); 00461 if (UseUndoable) 00462 OpToken += UndoSig; 00463 FamilyOpToken = OpToken; 00464 OpToken += pPlugIn->GetPlugInName(); 00465 FamilyOpToken += pPlugIn->GetFamilyName(); 00466 // check if we already have 00467 // if (FamilyOpToken != LastFamilyOpToken) 00468 // { 00469 // ok = ok && pContextMenu->BuildCommand(FamilyOpToken, FALSE, pMainRoot); 00470 // pFamilyRoot = pContextMenu->GetLastItem(); 00471 // } 00472 // ok = ok && pContextMenu->BuildCommand(OpToken, FALSE, pFamilyRoot); 00473 ok = ok && pContextMenu->BuildCommand(OpToken, FALSE, pMainRoot); 00474 00475 LastFamilyOpToken = FamilyOpToken; 00476 } 00477 00478 // Go to the next plug-in in the list 00479 pPlugIn = pManager->GetNextPlugIn(pPlugIn); 00480 } 00481 00482 // Tell the last item that it should have a separator 00483 if (pFamilyRoot != NULL && AddSeparator) 00484 pFamilyRoot->SetIsFollowedBySeparator(TRUE); 00485 } 00486 } 00487 00488 return ok; 00489 }
|
|
|
|
Reimplemented from PlugInsContextMenu. |
|
Reimplemented from PlugInsContextMenu. |