本文整理汇总了C++中XAP_App::getFrameCount方法的典型用法代码示例。如果您正苦于以下问题:C++ XAP_App::getFrameCount方法的具体用法?C++ XAP_App::getFrameCount怎么用?C++ XAP_App::getFrameCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XAP_App
的用法示例。
在下文中一共展示了XAP_App::getFrameCount方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DELETEP
static void
AikSaurusABI_RemoveFromMenus ()
{
// First we need to get a pointer to the application itself.
XAP_App *pApp = XAP_App::getApp();
// remove the edit method
EV_EditMethodContainer* pEMC = pApp->getEditMethodContainer() ;
EV_EditMethod * pEM = ev_EditMethod_lookup ( "AiksaurusABI_invoke" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
// now remove crap from the menus
int frameCount = pApp->getFrameCount();
XAP_Menu_Factory * pFact = pApp->getMenuFactory();
pFact->removeMenuItem("Main",NULL,AiksaurusABI_MenuLabel);
pFact->removeMenuItem("contextText",NULL,AiksaurusABI_MenuLabel);
for(int i = 0;i < frameCount;++i)
{
// Get the current frame that we're iterating through.
XAP_Frame* pFrame = pApp->getFrame(i);
pFrame->rebuildMenus();
}
}
示例2:
static void
AbiGOffice_removeFromMenus ()
{
// First we need to get a pointer to the application itself.
XAP_App *pApp = XAP_App::getApp();
XAP_Menu_Factory * pFact = pApp->getMenuFactory();
// remove the edit method
EV_EditMethodContainer* pEMC = pApp->getEditMethodContainer() ;
EV_EditMethod * pEM = ev_EditMethod_lookup ( "AbiGOChart_Create" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
pFact->removeMenuItem("Main",NULL,InsertGOChartID);
if (g_slist_length (mime_types) > 0) {
pEM = ev_EditMethod_lookup ( "AbiGOComponent_FileInsert" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
pEM = ev_EditMethod_lookup ( "AbiGOComponent_Create" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
pFact->removeMenuItem("Main",NULL,InsertGOComponentFromFileID);
pFact->removeMenuItem("Main",NULL,CreateGOComponentID);
}
pFact->removeMenuItem("Main",NULL,newObjectID);
int frameCount = pApp->getFrameCount();
for(int i = 0;i < frameCount;++i)
{
// Get the current frame that we're iterating through.
XAP_Frame* pFrame = pApp->getFrame(i);
pFrame->rebuildMenus();
}
}
示例3: focus_out_event_Modeless
static gboolean focus_out_event_Modeless(GtkWidget *widget,GdkEvent */*event*/,gpointer /*user_data*/)
{
XAP_App *pApp = static_cast<XAP_App *>(g_object_get_data(G_OBJECT(widget), "pApp"));
XAP_Frame *pFrame = pApp->getLastFocussedFrame();
if(pFrame ==static_cast<XAP_Frame *>(NULL))
{
UT_uint32 nframes = pApp->getFrameCount();
if(nframes > 0 && nframes < 10)
{
pFrame = pApp->getFrame(0);
}
else
{
return FALSE;
}
}
if(pFrame == static_cast<XAP_Frame *>(NULL)) return FALSE;
AV_View * pView = pFrame->getCurrentView();
UT_ASSERT_HARMLESS(pView);
if(pView!= NULL)
{
pView->focusChange(AV_FOCUS_NONE);
}
return FALSE;
}
示例4: AbiGOffice_addToMenus
//.........这里部分代码省略.........
// Create the Action that will be called.
EV_Menu_Action* myFileAction = new EV_Menu_Action(
InsertGOComponentFromFileID, // id that the layout said we could use
0, // no, we don't have a sub menu.
1, // yes, we raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
"AbiGOComponent_FileInsert", // name of callback function to call.
NULL, // don't know/care what this is for
NULL // don't know/care what this is for
);
// Now what we need to do is add this particular action to the ActionSet
// of the application. This forms the link between our new ID that we
// got for this particular frame with the EditMethod that knows how to
// call our callback function.
pActionSet->addAction(myFileAction);
CreateGOComponentID= pFact->addNewMenuAfter("Main",NULL,InsertGOComponentFromFileID,EV_MLF_Normal);
UT_DEBUGMSG(("CreateGOComponent ID %d \n",CreateGOComponentID));
pFact->addNewLabel(NULL, CreateGOComponentID,AbiGOComponent_MenuLabelCreate, AbiGOComponent_MenuTooltipCreate);
// Create the Action that will be called.
EV_Menu_Action* myCompAction = new EV_Menu_Action(
CreateGOComponentID, // id that the layout said we could use
0, // no, we don't have a sub menu.
1, // yes, we raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
"AbiGOComponent_Create", // name of callback function to call.
NULL, // don't know/care what this is for
NULL // don't know/care what this is for
);
// Now what we need to do is add this particular action to the ActionSet
// of the application. This forms the link between our new ID that we
// got for this particular frame with the EditMethod that knows how to
// call our callback function.
pActionSet->addAction(myCompAction);
if(!bObjectExists)
{
XAP_Menu_Id endObjectID= pFact->addNewMenuAfter("Main",NULL,CreateGOComponentID,EV_MLF_EndSubMenu);
UT_DEBUGMSG(("End Object ID %d \n",endObjectID));
pFact->addNewLabel(NULL,endObjectID,NULL,NULL);
// Create the Action that will be called.
EV_Menu_Action* myEndObjectAction = new EV_Menu_Action(
endObjectID, // id that the layout said we could use
0, // no, we don't have a sub menu.
0, // no, we raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
NULL, // name of callback function to call.
NULL, // don't know/care what this is for
NULL // don't know/care what this is for
);
pActionSet->addAction(myEndObjectAction);
}
}
else if(!bObjectExists)
{
XAP_Menu_Id endObjectID= pFact->addNewMenuAfter("Main",NULL,InsertGOChartID,EV_MLF_EndSubMenu);
UT_DEBUGMSG(("End Object ID %d \n",endObjectID));
pFact->addNewLabel(NULL,endObjectID,NULL,NULL);
// Create the Action that will be called.
EV_Menu_Action* myEndObjectAction = new EV_Menu_Action(
endObjectID, // id that the layout said we could use
0, // no, we don't have a sub menu.
0, // no, we raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
NULL, // name of callback function to call.
NULL, // don't know/care what this is for
NULL // don't know/care what this is for
);
pActionSet->addAction(myEndObjectAction);
}
// We need to go through and add the menu element to each "frame"
// of the application. We can iterate through the frames by doing
// XAP_App::getFrameCount() to tell us how many frames there are,
// then calling XAP_App::getFrame(i) to get the i-th frame.
int frameCount = pApp->getFrameCount();
for(int i = 0;i < frameCount;++i)
{
// Get the current frame that we're iterating through.
XAP_Frame* pFrame = pApp->getFrame(i);
pFrame->rebuildMenus();
}
}
示例5: AiksaurusABI_addToMenus
//
// AiksaurusABI_addToMenus
// -----------------------
// Adds "Thesaurus" option to AbiWord's Tools Menu.
//
static void
AiksaurusABI_addToMenus()
{
// First we need to get a pointer to the application itself.
XAP_App *pApp = XAP_App::getApp();
// Create an EditMethod that will link our method's name with
// it's callback function. This is used to link the name to
// the callback.
EV_EditMethod *myEditMethod = new EV_EditMethod(
"AiksaurusABI_invoke", // name of callback function
AiksaurusABI_invoke, // callback function itself.
0, // no additional data required.
"" // description -- allegedly never used for anything
);
// Now we need to get the EditMethod container for the application.
// This holds a series of Edit Methods and links names to callbacks.
EV_EditMethodContainer* pEMC = pApp->getEditMethodContainer();
// We have to add our EditMethod to the application's EditMethodList
// so that the application will know what callback to call when a call
// to "AiksaurusABI_invoke" is received.
pEMC->addEditMethod(myEditMethod);
// Now we need to grab an ActionSet. This is going to be used later
// on in our for loop. Take a look near the bottom.
EV_Menu_ActionSet* pActionSet = pApp->getMenuActionSet();
// We need to go through and add the menu element to each "frame"
// of the application. We can iterate through the frames by doing
// XAP_App::getFrameCount() to tell us how many frames there are,
// then calling XAP_App::getFrame(i) to get the i-th frame.
int frameCount = pApp->getFrameCount();
XAP_Menu_Factory * pFact = pApp->getMenuFactory();
//
// Put it in the context menu.
//
XAP_Menu_Id newID = pFact->addNewMenuAfter("contextText",NULL,"Bullets and &Numbering",EV_MLF_Normal);
pFact->addNewLabel(NULL,newID,AiksaurusABI_MenuLabel, AiksaurusABI_MenuTooltip);
//
// Also put it under word Wount in the main menu,
//
pFact->addNewMenuAfter("Main",NULL,"&Word Count",EV_MLF_Normal,newID);
// Create the Action that will be called.
EV_Menu_Action* myAction = new EV_Menu_Action(
newID, // id that the layout said we could use
0, // no, we don't have a sub menu.
1, // yes, we raise a dialog.
0, // no, we don't have a checkbox.
0,
"AiksaurusABI_invoke", // name of callback function to call.
NULL, // don't know/care what this is for
NULL // don't know/care what this is for
);
// Now what we need to do is add this particular action to the ActionSet
// of the application. This forms the link between our new ID that we
// got for this particular frame with the EditMethod that knows how to
// call our callback function.
pActionSet->addAction(myAction);
for(int i = 0;i < frameCount;++i)
{
// Get the current frame that we're iterating through.
XAP_Frame* pFrame = pApp->getFrame(i);
pFrame->rebuildMenus();
}
}
示例6: s_abicollab_remove_menus
/*!
* Remove the menu items unpon unloading the plugin.
*/
void s_abicollab_remove_menus()
{
// First we need to get a pointer to the application itself.
XAP_App *pApp = XAP_App::getApp();
// remove the edit method
EV_EditMethodContainer* pEMC = pApp->getEditMethodContainer();
EV_EditMethod * pEM;
pEM = ev_EditMethod_lookup ( "s_abicollab_offer" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
pEM = ev_EditMethod_lookup ( "s_abicollab_join" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
pEM = ev_EditMethod_lookup ( "s_abicollab_accounts" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
pEM = ev_EditMethod_lookup ( "s_abicollab_authors" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
#if !defined(ABICOLLAB_RECORD_ALWAYS) && defined(DEBUG)
pEM = ev_EditMethod_lookup ( "s_abicollab_record" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
#endif
#if defined(DEBUG)
pEM = ev_EditMethod_lookup ( "s_abicollab_viewrecord" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
#endif
pEM = ev_EditMethod_lookup ( "com.abisource.abiword.abicollab.command" ) ;
pEMC->removeEditMethod ( pEM ) ;
DELETEP( pEM ) ;
// now remove crap from the menus
int frameCount = pApp->getFrameCount();
XAP_Menu_Factory * pFact = pApp->getMenuFactory();
pFact->removeMenuItem("Main", NULL, szCollaboration);
pFact->removeMenuItem("Main", NULL, szCollaborationOffer);
pFact->removeMenuItem("Main", NULL, szCollaborationJoin);
pFact->removeMenuItem("Main", NULL, szCollaborationAccounts);
pFact->removeMenuItem("Main", NULL, szCollaborationShowAuthors);
#if !defined(ABICOLLAB_RECORD_ALWAYS) && defined(DEBUG)
pFact->removeMenuItem("Main", NULL, szCollaborationRecord);
#endif
#if defined(DEBUG)
pFact->removeMenuItem("Main", NULL, szCollaborationViewRecord);
#endif
pFact->removeMenuItem("Main", NULL, szEndCollaboration);
for (int i = 0; i < frameCount; ++i)
{
// Get the current frame that we're iterating through.
XAP_Frame* pFrame = pApp->getFrame(i);
pFrame->rebuildMenus();
}
}
示例7: s_abicollab_add_menus
/*!
* This implements the "Collaborate" main submenu.
*/
void s_abicollab_add_menus()
{
// First we need to get a pointer to the application itself.
XAP_App *pApp = XAP_App::getApp();
EV_EditMethodContainer* pEMC = pApp->getEditMethodContainer();
int frameCount = pApp->getFrameCount();
XAP_Menu_Factory * pFact = pApp->getMenuFactory();
EV_Menu_ActionSet* pActionSet = pApp->getMenuActionSet();
// TODO: make this a translatable set of strings
// const XAP_StringSet * pSS = pApp->getStringSet();
// The Collaboration menu item
XAP_Menu_Id collabId = pFact->addNewMenuBefore("Main", NULL, AP_MENU_ID_WINDOW, EV_MLF_BeginSubMenu);
pFact->addNewLabel(NULL, collabId, szCollaboration, szCollaborationTip);
EV_Menu_Action* myCollaborationAction = new EV_Menu_Action (
collabId, // id that the layout said we could use
1, // yes, we have a sub menu.
0, // no, we don't raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
NULL, // no callback function to call.
NULL, // Function for whether not label is enabled/disabled checked/unchecked
NULL // Function to compute Menu Label "Dynamic Label"
);
pActionSet->addAction(myCollaborationAction);
// The Start Collaboration connect item
XAP_Menu_Id collabOfferId = pFact->addNewMenuAfter("Main", NULL, collabId, EV_MLF_Normal);
pFact->addNewLabel(NULL, collabOfferId, szCollaborationOffer, szCollaborationOfferTip);
EV_Menu_Action* myActionOffer = new EV_Menu_Action (
collabOfferId, // id that the layout said we could use
0, // no, we don't have a sub menu.
1, // yes, we raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
"s_abicollab_offer", // name of callback function to call.
collab_GetState_CanShare, // Function for whether not label is enabled/disabled checked/unchecked
NULL // Function to compute Menu Label "Dynamic Label"
);
pActionSet->addAction(myActionOffer);
EV_EditMethod *myEditMethodOffer = new EV_EditMethod (
"s_abicollab_offer", // name of callback function
s_abicollab_offer, // callback function itself.
0, // no additional data required.
"" // description -- allegedly never used for anything
);
pEMC->addEditMethod(myEditMethodOffer);
// The Join Collaboration connect item
XAP_Menu_Id collabJoinId = pFact->addNewMenuAfter("Main", NULL, collabOfferId, EV_MLF_Normal);
pFact->addNewLabel(NULL, collabJoinId, szCollaborationJoin, szCollaborationJoinTip);
EV_Menu_Action* myActionJoin = new EV_Menu_Action (
collabJoinId, // id that the layout said we could use
0, // no, we don't have a sub menu.
1, // yes, we raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
"s_abicollab_join", // name of callback function to call.
collab_GetState_AnyActive, // Function for whether not label is enabled/disabled checked/unchecked
NULL // Function to compute Menu Label "Dynamic Label"
);
pActionSet->addAction(myActionJoin);
EV_EditMethod *myEditMethodJoin = new EV_EditMethod (
"s_abicollab_join", // name of callback function
s_abicollab_join, // callback function itself.
0, // no additional data required.
"" // description -- allegedly never used for anything
);
pEMC->addEditMethod(myEditMethodJoin);
// The Join Collaboration connect item
XAP_Menu_Id collabAccountsId = pFact->addNewMenuAfter("Main", NULL, collabJoinId, EV_MLF_Normal);
pFact->addNewLabel(NULL, collabAccountsId, szCollaborationAccounts, szCollaborationAccountsTip);
EV_Menu_Action* myActionAccounts = new EV_Menu_Action (
collabAccountsId, // id that the layout said we could use
0, // no, we don't have a sub menu.
1, // yes, we raise a dialog.
0, // no, we don't have a checkbox.
0, // no radio buttons for me, thank you
"s_abicollab_accounts", // name of callback function to call.
NULL, // Function for whether not label is enabled/disabled checked/unchecked
NULL // Function to compute Menu Label "Dynamic Label"
);
pActionSet->addAction(myActionAccounts);
EV_EditMethod *myEditMethodAccounts = new EV_EditMethod (
"s_abicollab_accounts", // name of callback function
s_abicollab_accounts, // callback function itself.
0, // no additional data required.
"" // description -- allegedly never used for anything
);
pEMC->addEditMethod(myEditMethodAccounts);
// The Show Authors item
//.........这里部分代码省略.........