本文整理汇总了C++中XAP_Frame类的典型用法代码示例。如果您正苦于以下问题:C++ XAP_Frame类的具体用法?C++ XAP_Frame怎么用?C++ XAP_Frame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XAP_Frame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: UT_DEBUGMSG
void AbiCollab::_setDocument(PD_Document* pDoc)
{
UT_DEBUGMSG(("AbiCollab::setDocument()\n"));
UT_return_if_fail(pDoc);
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
UT_return_if_fail(pManager);
// assume clean state
UT_return_if_fail(m_iDocListenerId==0);
m_pDoc = pDoc;
// register ourselves as a mouse listener to all frames showing this document
for (UT_sint32 i = 0; i < XAP_App::getApp()->getFrameCount(); i++)
{
XAP_Frame* pFrame = XAP_App::getApp()->getFrame(i);
UT_continue_if_fail(pFrame);
if (pFrame->getCurrentDoc() == m_pDoc)
{
// this frame is showing our document, attach a mouse listener to it
EV_Mouse* pMouse = pFrame->getMouse();
if (pMouse)
m_mMouseListenerIds[pMouse] = pMouse->registerListener(this);
}
}
// add the new export listeners
UT_uint32 lid = 0;
pDoc->addListener(static_cast<PL_Listener *>(&m_Export), &lid);
_setDocListenerId(lid);
UT_DEBUGMSG(("Added document listener %d\n", lid));
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:33,代码来源:AbiCollab.cpp
示例2: AbiGOffice_removeFromMenus
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();
}
}
开发者ID:hfiguiere,项目名称:abiword,代码行数:33,代码来源:AbiGOffice.cpp
示例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;
}
开发者ID:Distrotech,项目名称:abiword,代码行数:25,代码来源:xap_UnixDialogHelper.cpp
示例4: URLDict_invoke
//
// URLDict_invoke
// -------------------
// This is the function that we actually call to invoke the on-line dictionary.
// It should be called when the user selects from the context menu
//
static bool
URLDict_invoke(AV_View* /*v*/, EV_EditMethodCallData * /*d*/)
{
// Get the current view that the user is in.
XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame();
FV_View* pView = static_cast<FV_View*>(pFrame->getCurrentView());
// If the user is on a word, but does not have it selected, we need
// to go ahead and select that word so that the search/replace goes
// correctly.
pView->moveInsPtTo(FV_DOCPOS_EOW_MOVE);
pView->moveInsPtTo(FV_DOCPOS_BOW);
pView->extSelTo(FV_DOCPOS_EOW_SELECT);
// Now we will figure out what word to look up when we open our dialog.
UT_String url ("http://www.dict.org/bin/Dict?Form=Dict1&Database=*&Strategy=*&Query=");
if (!pView->isSelectionEmpty())
{
// We need to get the Ascii version of the current word.
UT_UCS4Char *ucs4ST;
pView->getSelectionText(*&ucs4ST);
char* search = _ucsToAscii(
ucs4ST
);
url += search;
DELETEPV(search);
FREEP(ucs4ST);
}
XAP_App::getApp()->openURL( url.c_str() );
return true;
}
开发者ID:Distrotech,项目名称:abiword,代码行数:40,代码来源:AbiURLDict.cpp
示例5: AikSaurusABI_RemoveFromMenus
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();
}
}
开发者ID:hfiguiere,项目名称:abiword,代码行数:25,代码来源:AiksaurusABI.cpp
示例6: UT_return_val_if_fail
bool XAP_App::updateClones(XAP_Frame * pFrame)
{
UT_return_val_if_fail(pFrame,false);
UT_ASSERT(pFrame->getViewNumber() > 0);
// locate vector of this frame's clones
UT_GenericVector<XAP_Frame*>* pEntry = m_hashClones.pick(pFrame->getViewKey());
UT_ASSERT_HARMLESS(pEntry);
if (pEntry)
{
UT_GenericVector<XAP_Frame*>* pvClones = pEntry;
UT_return_val_if_fail(pvClones,false);
UT_uint32 count = pvClones->getItemCount();
UT_ASSERT(count > 0);
XAP_Frame * f = NULL;
for (UT_uint32 j=0; j<count; j++)
{
f = pvClones->getNthItem(j);
UT_continue_if_fail(f);
f->updateTitle();
}
}
return true;
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:29,代码来源:xap_App.cpp
示例7: g_return_val_if_fail
bool Presentation::end(void)
{
if(m_sPrevBindings.size() == 0)
return false;
EV_EditMethodContainer * pEMC = m_pApp->getEditMethodContainer();
g_return_val_if_fail (pEMC != 0, FALSE);
UT_sint32 i = m_pApp->setInputMode(m_sPrevBindings.c_str());
if(i <=0 )
return false;
// get a handle to the actual EditMethod
EV_EditMethod * pFullScreen = pEMC->findEditMethodByName ("viewFullScreen");
g_return_val_if_fail (pFullScreen != 0, false);
const char * sz ="";
EV_EditMethodCallData calldata(sz,0);
calldata.m_xPos = 0;
calldata.m_yPos = 0;
XAP_Frame * pFrame = static_cast<XAP_Frame*>(m_pView->getParentData());
pFrame->hideMenuScroll(false);
bool b= (pFullScreen->Fn(static_cast<AV_View *>(m_pView),&calldata) ? TRUE : FALSE);
pFrame->setZoomType(m_OldZoomType);
pFrame->setZoomPercentage(m_iOldZoom);
pFrame->quickZoom(m_iOldZoom);
return b;
}
开发者ID:Distrotech,项目名称:abiword,代码行数:26,代码来源:Presentation.cpp
示例8: AbiMathView_LatexInsert
//
// AbiMathView_LatexInsert
// -------------------
// This is the function that we actually call to insert the MathML from
// a Latex expression.
//
bool
AbiMathView_LatexInsert(AV_View* v, EV_EditMethodCallData* /*d*/)
{
FV_View * pView = static_cast<FV_View *>(v);
XAP_Frame * pFrame = static_cast<XAP_Frame *> ( pView->getParentData());
pFrame->raise();
XAP_DialogFactory * pDialogFactory
= static_cast<XAP_DialogFactory *>(XAP_App::getApp()->getDialogFactory());
AP_Dialog_Latex * pDialog
= static_cast<AP_Dialog_Latex *>(pDialogFactory->requestDialog(AP_DIALOG_ID_LATEX));
UT_return_val_if_fail(pDialog, false);
if (pDialog->isRunning())
{
pDialog->activate();
}
else
{
pDialog->runModeless(pFrame);
}
return true;
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:31,代码来源:AbiMathView.cpp
示例9: GDict_invoke
//
// GDict_invoke
// -------------------
// This is the function that we actually call to invoke the thesaurus.
// It should be called when the user hits the thesaurus key (shift+f7?)
// or chooses "thesaurus" from a menu.
//
static bool
GDict_invoke(AV_View* /*v*/, EV_EditMethodCallData */*d*/)
{
// Get the current view that the user is in.
XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame();
FV_View* pView = static_cast<FV_View*>(pFrame->getCurrentView());
// If the user is on a word, but does not have it selected, we need
// to go ahead and select that word so that the search/replace goes
// correctly.
pView->moveInsPtTo(FV_DOCPOS_EOW_MOVE);
pView->moveInsPtTo(FV_DOCPOS_BOW);
pView->extSelTo(FV_DOCPOS_EOW_SELECT);
// We need to get the utf-8 version of the current word.
UT_UCS4Char *ucs4ST = NULL;
pView->getSelectionText(*&ucs4ST);
if (ucs4ST) {
UT_UTF8String search(ucs4ST);
GDict_exec (search.utf8_str());
FREEP(ucs4ST);
}
return true;
}
开发者ID:Distrotech,项目名称:abiword,代码行数:32,代码来源:GdictAbiPlugin.cpp
示例10: UT_return_val_if_fail
bool AbiCollabSessionManager::_setupFrame(XAP_Frame** pFrame, PD_Document* pDoc)
{
UT_return_val_if_fail(pFrame, false);
if (*pFrame)
{
UT_DEBUGMSG(("Frame is non-NULL, NOT loading document in the frame\n"));
return true;
}
// if the document doesn't belong to a frame already, then create a
// new frame for this session (except when the document in the current
// frame is not dirty, doesn't have a filename yet (which means it
// is a brand new empty document), and isn't being shared at the moment)
XAP_Frame* pCurFrame = XAP_App::getApp()->getLastFocussedFrame();
UT_return_val_if_fail(pCurFrame, false);
bool isNewFrame = false;
PD_Document * pFrameDoc = static_cast<PD_Document *>(pCurFrame->getCurrentDoc());
if (pFrameDoc != pDoc)
{
if (!pFrameDoc || (pFrameDoc->getFilename().empty() && !pFrameDoc->isDirty() && !isInSession(pFrameDoc)))
{
// we can replace the document in this frame safely, as it is
// brand new, and doesn't have any contents yet
}
else
{
// the current frame has already a document loaded, let's create
// a new frame
pCurFrame = XAP_App::getApp()->newFrame();
isNewFrame = true;
}
}
else
{
UT_DEBUGMSG(("This document is already in the current frame; using this frame\n"));
}
UT_return_val_if_fail(pCurFrame, false);
*pFrame = pCurFrame;
// load the document in the frame; this will also delete the old document (or at least, it should)
if (static_cast<PD_Document *>((*pFrame)->getCurrentDoc()) != pDoc)
{
UT_DEBUGMSG(("Loading the document in the frame\n"));
(*pFrame)->loadDocument(pDoc);
}
else
{
UT_DEBUGMSG(("Not loading the document in the frame, as the frame already has it\n"));
}
if (isNewFrame)
(*pFrame)->show();
return true;
}
开发者ID:hfiguiere,项目名称:abiword,代码行数:59,代码来源:AbiCollabSessionManager.cpp
示例11: UT_DEBUGMSG
ConnectResult XMPPAccountHandler::connect()
{
UT_DEBUGMSG(("XMPPAccountHandler::connect()\n"));
if (m_bLoggedIn)
return CONNECT_ALREADY_CONNECTED;
if (m_pConnection)
return CONNECT_IN_PROGRESS;
// try to request a frame here; note that this might return 0, for example on application startup
XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame();
const std::string server = getProperty("server");
const std::string username = getProperty("username");
const std::string port = getProperty("port"); // TODO: unused atm
const std::string resource = getProperty("resource");
const std::string encryption = getProperty("encryption");
std::string jid = username + "@" + server;
UT_DEBUGMSG(("Connecting to server: |%s|, username: |%s|, resource: |%s|\n",
server.c_str(), username.c_str(), resource.c_str()));
// NULL means perform SRV record lookup based on JID (Loudmouth 1.3.2+)
m_pConnection = lm_connection_new(NULL);
UT_return_val_if_fail(m_pConnection, CONNECT_INTERNAL_ERROR);
lm_connection_set_jid(m_pConnection, jid.c_str());
// setup SSL
if (lm_ssl_is_supported() && encryption == "true")
{
LmSSL* pSSL = lm_ssl_new(NULL, NULL, NULL, NULL); // TODO: free this
lm_ssl_use_starttls(pSSL, TRUE, TRUE);
lm_connection_set_ssl(m_pConnection, pSSL);
lm_ssl_unref(pSSL);
}
GError* error = NULL;
if (!lm_connection_open(m_pConnection, lm_connection_open_async_cb, this, NULL, &error))
{
UT_DEBUGMSG(("Failed to open: %s\n", error ? error->message : ""));
lm_connection_unref(m_pConnection);
m_pConnection = NULL;
if (pFrame)
{
// inform the user of the connection failure
// TODO: this shouldn't be here, the caller should handle this
UT_UTF8String msg;
// TODO: make this localizable
UT_UTF8String_sprintf(msg, "Error while connecting to %s: %s\n", server.c_str(), (error ? error->message : ""));
pFrame->showMessageBox(msg.utf8_str(), XAP_Dialog_MessageBox::b_O, XAP_Dialog_MessageBox::a_OK);
}
return CONNECT_FAILED;
}
return CONNECT_IN_PROGRESS;
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:59,代码来源:XMPPAccountHandler.cpp
示例12: getFrame
// Does the initial show/hide of statusbar (based on the user prefs).
// Idem.
void AP_UnixFrameImpl::_showOrHideStatusbar()
{
#ifdef ENABLE_STATUSBAR
XAP_Frame* pFrame = getFrame();
bool bShowStatusBar = static_cast<AP_FrameData*> (pFrame->getFrameData())->m_bShowStatusBar;
static_cast<AP_UnixFrame *>(pFrame)->toggleStatusBar(bShowStatusBar);
#endif
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:10,代码来源:ap_UnixFrameImpl.cpp
示例13: AbiGOComponent_Create
//
// AbiGOComponent_Create
// -------------------
// This is the function that we actually call to insert a new intially empty component.
bool
AbiGOComponent_Create (G_GNUC_UNUSED AV_View* v, G_GNUC_UNUSED EV_EditMethodCallData *d)
{
XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame();
XAP_UnixFrameImpl *pFrameImpl = static_cast<XAP_UnixFrameImpl*>(pFrame->getFrameImpl());
std::string cancel, ok;
const XAP_StringSet *pSS = XAP_App::getApp()->getStringSet();
pSS->getValueUTF8(XAP_STRING_ID_DLG_Cancel, cancel);
pSS->getValueUTF8(XAP_STRING_ID_DLG_OK, ok);
GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new_with_buttons ("New Object",
GTK_WINDOW(pFrameImpl->getTopLevelWindow()),
(GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
convertMnemonics(cancel).c_str(), GTK_RESPONSE_CANCEL,
convertMnemonics(ok).c_str(), GTK_RESPONSE_OK, NULL));
GtkListStore *list = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
GtkWidget *w = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list));
g_signal_connect_swapped(w, "button-press-event", G_CALLBACK(button_press_cb), dialog);
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Object type:", renderer, "text", 0, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (w), column);
GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW (w));
gtk_tree_selection_set_mode (sel, GTK_SELECTION_BROWSE);
GtkTreeIter iter;
GSList *l = mime_types;
gchar const *mime_type;
while (l) {
mime_type = (gchar const *) l->data;
if (strcmp(mime_type, "application/mathml+xml")
&& go_components_get_priority(mime_type) >= GO_MIME_PRIORITY_PARTIAL)
{
gtk_list_store_append (list, &iter);
gtk_list_store_set (list, &iter,
0, go_mime_type_get_description (mime_type),
1, mime_type,
-1);
}
l = l->next;
}
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area(dialog)), w, false, false, 0);
gtk_widget_show_all (GTK_WIDGET(dialog));
gint result = gtk_dialog_run (dialog);
if (result == GTK_RESPONSE_OK &&
gtk_tree_selection_get_selected (sel, NULL, &iter)) {
gtk_tree_model_get (GTK_TREE_MODEL (list), &iter, 1, &mime_type, -1);
GOComponent *component = go_component_new_by_mime_type (mime_type);
go_component_set_inline (component, true);
go_component_set_use_font_from_app (component, true);
g_signal_connect (G_OBJECT (component), "changed",
G_CALLBACK (changed_cb), NULL);
GtkWindow *win = go_component_edit(component);
gtk_window_set_transient_for(win, GTK_WINDOW(pFrameImpl->getTopLevelWindow()));
}
gtk_widget_destroy (GTK_WIDGET (dialog));
return result == GTK_RESPONSE_OK;
}
开发者ID:hfiguiere,项目名称:abiword,代码行数:61,代码来源:AbiGOComponent.cpp
示例14: getActiveFrame
FV_View * AP_Dialog_Modeless::getView(void) const
{
XAP_Frame * pFrame = getActiveFrame();
if (pFrame)
return (FV_View *) pFrame->getCurrentView();
else
return NULL;
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:9,代码来源:ap_Dialog_Modeless.cpp
示例15: FreeTranslation_invoke
//
// FreeTranslate_invoke
// -------------------
// This is the function that we actually call to invoke the
// online freetranslation translation
// It should be called when the user selects from the context menu
//
static
bool FreeTranslation_invoke(AV_View * /*v*/, EV_EditMethodCallData * /*d*/)
{
// Get the current view that the user is in.
XAP_Frame * pFrame = XAP_App::getApp()->getLastFocussedFrame();
FV_View * pView =
static_cast <FV_View *>(pFrame->getCurrentView());
std::string url("http://www.freetranslation.com");
if (!pView->isSelectionEmpty())
{
std::string langCode;
if (_getTranslationCode(pView, langCode))
{
// Now we will figure out what words to translate
// We need to get the Latin1 version of the current word.
UT_UCS4Char *ucs4ST;
pView->getSelectionText(*&ucs4ST);
char * translate = _ucs4ToLatin1(ucs4ST);
// URL encode the string (' ' -> %20, ...)
// TODO this is not complete
std::string srcText;
for (char *p = translate; p && *p; ++p)
{
if (*p == ' ' || *p == '%' || *p == '&' || *p == '?'
|| (*p & 128)) // sometime char is signed.
// do bitwise comparison for portability
{
char temp[4] = "";
sprintf(&temp[0], "%%%x", *p);
srcText += temp;
} else
srcText += *p;
}
url = "http://ets.freetranslation.com/?Sequence=core";
url += "&Language=";
url += langCode;
url += "&SrcText=";
url += srcText;
DELETEPV(translate);
FREEP(ucs4ST);
XAP_App::getApp()->openURL(url.c_str());
}
// else didn't get the translation code. don't show anything
} else {
XAP_App::getApp()->openURL(url.c_str());
}
return true;
}
开发者ID:hfiguiere,项目名称:abiword,代码行数:63,代码来源:AbiFreeTranslation.cpp
示例16: findValidFrame
GR_Graphics * AP_Win32App::newDefaultScreenGraphics() const
{
XAP_Frame * pFrame = findValidFrame();
UT_return_val_if_fail( pFrame, NULL );
AP_Win32FrameImpl * pFI = (AP_Win32FrameImpl *) pFrame->getFrameImpl();
UT_return_val_if_fail( pFI, NULL );
return pFI->createDocWndGraphics();
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:10,代码来源:ap_Win32App.cpp
示例17: doOptions
UT_Error IE_Exp_EPUB::doOptions()
{
XAP_Frame * pFrame = XAP_App::getApp()->getLastFocussedFrame();
if (!pFrame || isCopying()) return UT_OK;
if (pFrame)
{
AV_View * pView = pFrame->getCurrentView();
if (pView)
{
GR_Graphics * pG = pView->getGraphics();
if (pG && pG->queryProperties(GR_Graphics::DGP_PAPER))
{
return UT_OK;
}
}
}
//FIXME:FIDENCIO: Remove this clause when Cocoa's dialog is implemented
#ifdef TOOLKIT_COCOA
return UT_OK;
#else
/* run the dialog
*/
XAP_Dialog_Id id = m_iDialogExport;
XAP_DialogFactory * pDialogFactory
= static_cast<XAP_DialogFactory *> (XAP_App::getApp()->getDialogFactory());
AP_Dialog_EpubExportOptions* pDialog
= static_cast<AP_Dialog_EpubExportOptions*> (pDialogFactory->requestDialog(id));
if (pDialog == NULL)
{
return UT_OK;
}
pDialog->setEpubExportOptions(&m_exp_opt, XAP_App::getApp());
pDialog->runModal(pFrame);
/* extract what they did
*/
bool bSave = pDialog->shouldSave();
pDialogFactory->releaseDialog(pDialog);
if (!bSave)
{
return UT_SAVE_CANCELLED;
}
return UT_OK;
#endif
}
开发者ID:hfiguiere,项目名称:abiword,代码行数:55,代码来源:ie_exp_EPUB.cpp
示例18: setAllSensitivities
/*!
Sets the sensitivity of the radio buttons to top/bottom/left/right line buttons
Call this right after contructing the widget and before dropping into the main loop.
*/
void AP_Dialog_FormatTable::setAllSensitivities(void)
{
XAP_Frame *frame = XAP_App::getApp()->getLastFocussedFrame();
if (frame) {
FV_View * pView = static_cast<FV_View *>(frame->getCurrentView());
setSensitivity(pView->isInTable());
}
else {
setSensitivity(false);
}
}
开发者ID:tanya-guza,项目名称:abiword,代码行数:15,代码来源:ap_Dialog_FormatTable.cpp
示例19: UT_DEBUGMSG
void AP_Dialog_CollaborationShare::share(AccountHandler* pAccount, const std::vector<std::string>& vAcl)
{
UT_DEBUGMSG(("AP_Dialog_CollaborationShare::_share()\n"));
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
UT_return_if_fail(pManager);
// determine which document to share
XAP_Frame* pFrame = XAP_App::getApp()->getLastFocussedFrame();
UT_return_if_fail(pFrame);
PD_Document* pDoc = static_cast<PD_Document *>(pFrame->getCurrentDoc());
UT_return_if_fail(pDoc);
AbiCollab* pSession = NULL;
if (!pManager->isInSession(pDoc))
{
UT_DEBUGMSG(("Sharing document...\n"));
// FIXME: this can cause a race condition: the other side can already be
// offered the session before we actually started it!
// Tell the account handler that we start a new session, so
// it set up things if needed. This call may just setup some stuff
// for a new session, or it might actually start a new session.
bool b = pAccount->startSession(pDoc, m_vAcl, &pSession);
if (!b)
{
XAP_App::getApp()->getLastFocussedFrame()->showMessageBox(
"There was an error sharing this document!",
XAP_Dialog_MessageBox::b_O, XAP_Dialog_MessageBox::a_OK);
return;
}
// start the session ourselves when the account handler did not...
if (!pSession)
{
// ... and start the session!
UT_UTF8String sSessionId("");
// TODO: we could use/generate a proper descriptor when there is only
// 1 account where we share this document over
pSession = pManager->startSession(pDoc, sSessionId, pAccount, true, NULL, "");
}
}
else
{
pSession = pManager->getSession(pDoc);
}
UT_return_if_fail(pSession);
pManager->updateAcl(pSession, pAccount, vAcl);
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:52,代码来源:ap_Dialog_CollaborationShare.cpp
示例20: findValidFrame
GR_Graphics * AP_UnixApp::newDefaultScreenGraphics() const
{
XAP_Frame * pFrame = findValidFrame();
UT_return_val_if_fail( pFrame, NULL );
UT_DEBUGMSG(("AP_UnixApp::newDefaultScreenGraphics() \n"));
AP_UnixFrameImpl * pFI = static_cast<AP_UnixFrameImpl *>(pFrame->getFrameImpl());
UT_return_val_if_fail( pFI, NULL );
GtkWidget * da = pFI->getDrawingArea();
UT_return_val_if_fail( da, NULL );
GR_UnixCairoAllocInfo ai(da);
return XAP_App::getApp()->newGraphics(ai);
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:14,代码来源:ap_UnixApp.cpp
注:本文中的XAP_Frame类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论