bool AP_Dialog_Modeless::setView(FV_View * /*view*/) { if (getActiveFrame()) m_pView = (FV_View *) getActiveFrame()->getCurrentView(); else m_pView = NULL; return true; }
/*! * This method sets the height and width of the preview from * the size of the comment in the annotation. */ void AP_Preview_Annotation::setSizeFromAnnotation(void) { FV_View * pView = static_cast<FV_View *>(getActiveFrame()->getCurrentView()); GR_Graphics * pG = NULL; UT_return_if_fail(pView); pG = pView->getGraphics(); UT_return_if_fail(pG); GR_Font * pFont = pG->findFont("Times New Roman", "normal", "normal", "normal", "normal", "12pt", NULL); UT_return_if_fail(pFont); double rat = 100./static_cast<double>(pG->getZoomPercentage()); UT_sint32 iHeight = pG->getFontAscent(pFont) + pG->tlu(7); iHeight = static_cast<UT_sint32>(static_cast<double>(iHeight)); m_drawString = m_sDescription; UT_sint32 len = m_drawString.size(); pG->setFont(pFont); UT_sint32 iwidth = pG->measureString(m_drawString.ucs4_str(),0,len,NULL) + pG->tlu(6); iwidth = static_cast<UT_sint32>(static_cast<double>(iwidth)); m_width = static_cast<UT_sint32>(static_cast<double>(pG->tdu(iwidth))*rat); m_height = static_cast<UT_sint32>(static_cast<double>(pG->tdu(iHeight))*rat); if(pG->tdu(pView->getWindowWidth()) < m_width) m_width = pG->tdu(pView->getWindowWidth()); UT_DEBUGMSG(("SetSize from Annotation width %d rat %f \n",m_width,rat)); }
FV_View * AP_Dialog_Modeless::getView(void) const { XAP_Frame * pFrame = getActiveFrame(); if (pFrame) return (FV_View *) pFrame->getCurrentView(); else return NULL; }
bool dyn_lwp::decodeSyscallTrap(EventRecord &ev) { if (!trappedSyscall_) return false; Frame active = getActiveFrame(); if (active.getPC() == trappedSyscall_->syscall_id) { ev.type = evtSyscallExit; ev.what = trappedSyscall_->syscall_id; return true; } return false; } /* end hasReachedSyscallTrap() */
void XAP_Dialog_Insert_Symbol::_insert(UT_UCSChar c, const char* symfont) { UT_return_if_fail(m_pListener); UT_ASSERT(symfont); if (c == 0x00) { // Pango certainly doesn't like shaping 0x00 characters (it crashes when trying), // and I'm not sure if other font renderers do. Since it doesn't really make // any sense to allow such characters in the first place, let's just drop // it on the floor. - MARCM UT_DEBUGMSG(("Dropping 0x00 character on the floor\n")); return; } // connect to the current active frame using the robust getActiveFrame m_pListener->setView(getActiveFrame()->getCurrentView()); UT_DEBUGMSG(("Insert Char %x \n",c)); m_pListener->insertSymbol(c, symfont); }
void AP_Dialog_SplitCells::setActiveFrame(XAP_Frame * /*pFrame*/) { notifyActiveFrame(getActiveFrame()); }
Address dyn_lwp::getCurrentSyscall() { Frame active = getActiveFrame(); return active.getPC(); }
void AP_Dialog_FormatFrame::setActiveFrame(XAP_Frame * /*pFrame*/) { notifyActiveFrame(getActiveFrame()); }
void AP_Dialog_Modeless::setActiveFrame(XAP_Frame * /*pFrame*/) { setView(getView()); notifyActiveFrame(getActiveFrame()); }
/*! * Fill the GUI tree with the styles as defined in the XP tree. */ void AP_UnixDialog_FormatTOC::_fillGUI(void) { UT_UTF8String sVal; sVal = getTOCPropVal("toc-has-heading"); GtkWidget * pW; GtkComboBox * combo = GTK_COMBO_BOX(_getWidget("wLevelOption")); gtk_combo_box_set_active(combo, getMainLevel()-1); pW = _getWidget("cbHasHeading"); if(g_ascii_strcasecmp(sVal.utf8_str(),"1") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pW),TRUE); _setHasHeadingSensitivity(TRUE); } else { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pW),FALSE); _setHasHeadingSensitivity(FALSE); } g_object_set_data(G_OBJECT(pW),"toc-prop",(gpointer) "toc-has-heading"); g_signal_connect(G_OBJECT(pW), "toggled", G_CALLBACK(s_HasHeading_changed), (gpointer) this); sVal = getTOCPropVal("toc-heading"); pW = _getWidget("edHeadingText"); gtk_entry_set_text(GTK_ENTRY(pW),sVal.utf8_str()); g_object_set_data(G_OBJECT(pW),"toc-prop",(gpointer) "toc-heading"); sVal = getTOCPropVal("toc-heading-style"); pW = _getWidget("lbCurrentHeadingStyle"); gtk_label_set_text(GTK_LABEL(pW),sVal.utf8_str()); g_object_set_data(G_OBJECT(_getWidget("lbChangeHeadingStyle")),"display-widget",(gpointer)pW); g_object_set_data(G_OBJECT(pW),"toc-prop",(gpointer) "toc-heading-style"); FV_View * pView = static_cast<FV_View *>(getActiveFrame()->getCurrentView()); sVal = getTOCPropVal("toc-dest-style",getMainLevel()); pW= _getWidget("wDispStyle"); gtk_label_set_text(GTK_LABEL(pW),sVal.utf8_str()); g_object_set_data(G_OBJECT(_getWidget("wChangeDisp")),"display-widget",(gpointer)pW); g_object_set_data(G_OBJECT(pW),"toc-prop",(gpointer) "toc-dest-style"); sVal = getTOCPropVal("toc-has-label",getMainLevel()); pW = _getWidget("wHasLabel"); if(g_ascii_strcasecmp(sVal.utf8_str(),"1") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pW),TRUE); } else { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pW),FALSE); } g_object_set_data(G_OBJECT(pW),"toc-prop",(gpointer) "toc-has-label"); g_signal_connect(G_OBJECT(pW), "toggled", G_CALLBACK(s_HasLabel_changed), (gpointer) this); sVal = getTOCPropVal("toc-label-after",getDetailsLevel()); pW = _getWidget("edTextAfter"); gtk_entry_set_text(GTK_ENTRY(pW),sVal.utf8_str()); g_object_set_data(G_OBJECT(pW),"toc-prop",(gpointer) "toc-label-after"); sVal = getTOCPropVal("toc-label-before",getDetailsLevel()); pW = _getWidget("edTextBefore"); gtk_entry_set_text(GTK_ENTRY(pW),sVal.utf8_str()); g_object_set_data(G_OBJECT(pW),"toc-prop",(gpointer) "toc-label-before"); sVal = getTOCPropVal("toc-label-inherits",getDetailsLevel()); pW = _getWidget("cbInherit"); if(g_ascii_strcasecmp(sVal.utf8_str(),"1") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pW),TRUE); } else { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pW),FALSE); } g_object_set_data(G_OBJECT(pW),"toc-prop",(gpointer) "toc-label-inherits"); g_signal_connect(G_OBJECT(pW), "toggled", G_CALLBACK(s_check_changedDetails), (gpointer) this); sVal = getTOCPropVal("toc-label-start",getDetailsLevel()); pW = _getWidget("wStartEntry"); gtk_entry_set_text(GTK_ENTRY(pW),sVal.utf8_str()); gtk_spin_button_set_value(GTK_SPIN_BUTTON (_getWidget("wStartSpin")), (gdouble) m_iStartValue ); g_signal_connect(G_OBJECT(_getWidget("wStartSpin")), "value-changed", G_CALLBACK(s_StartAt_changed), reinterpret_cast<gpointer>(this)); sVal = getTOCPropVal("toc-indent",getDetailsLevel()); pW = _getWidget("wIndentEntry"); gtk_entry_set_text(GTK_ENTRY(pW),sVal.utf8_str()); gtk_spin_button_set_value(GTK_SPIN_BUTTON (_getWidget("wIndentSpin")), (gdouble) m_iIndentValue ); g_signal_connect(G_OBJECT(_getWidget("wIndentSpin")), "value-changed", G_CALLBACK(s_Indent_changed), reinterpret_cast<gpointer>(this)); sVal = getTOCPropVal("toc-label-type",getDetailsLevel()); pW = _getWidget("wLabelChoose"); UT_sint32 iHist = static_cast<UT_sint32>(pView->getLayout()->FootnoteTypeFromString(sVal.utf8_str())); XAP_comboBoxSetActiveFromIntCol(GTK_COMBO_BOX(pW),1,iHist); sVal = getTOCPropVal("toc-page-type",getDetailsLevel()); pW = _getWidget("wPageNumberingChoose"); iHist = static_cast<UT_sint32>(pView->getLayout()->FootnoteTypeFromString(sVal.utf8_str())); XAP_comboBoxSetActiveFromIntCol(GTK_COMBO_BOX(pW),1,iHist); sVal = getTOCPropVal("toc-source-style",getMainLevel()); pW = _getWidget("wFillStyle"); gtk_label_set_text(GTK_LABEL(pW),sVal.utf8_str()); g_object_set_data(G_OBJECT(_getWidget("wChangeFill")),"display-widget",(gpointer)pW); g_object_set_data(G_OBJECT(pW),"toc-prop",(gpointer) "toc-source-style"); sVal = getTOCPropVal("toc-tab-leader",getDetailsLevel()); pW = _getWidget("wTabLeaderChoose"); if(g_ascii_strcasecmp(sVal.utf8_str(),"none") == 0) { iHist = 0; } else if(g_ascii_strcasecmp(sVal.utf8_str(),"dot") == 0) { iHist = 1; } else if(g_ascii_strcasecmp(sVal.utf8_str(),"hyphen") == 0) { iHist = 2; } else if(g_ascii_strcasecmp(sVal.utf8_str(),"underline") == 0) { iHist = 3; } else { iHist = 1; } gtk_combo_box_set_active(GTK_COMBO_BOX(pW),iHist); }
void AP_UnixDialog_FormatTOC::setDetailsLevel(UT_sint32 iLevel) { AP_Dialog_FormatTOC::setDetailsLevel(iLevel); UT_UTF8String sVal; sVal = getTOCPropVal("toc-label-after",getDetailsLevel()); GtkWidget * pW = _getWidget("edTextAfter"); gtk_entry_set_text(GTK_ENTRY(pW),sVal.utf8_str()); sVal = getTOCPropVal("toc-label-before",getDetailsLevel()); pW = _getWidget("edTextBefore"); gtk_entry_set_text(GTK_ENTRY(pW),sVal.utf8_str()); sVal = getTOCPropVal("toc-label-start",getDetailsLevel()); pW = _getWidget("wStartEntry"); gtk_entry_set_text(GTK_ENTRY(pW),sVal.utf8_str()); sVal = getTOCPropVal("toc-indent",getDetailsLevel()); pW = _getWidget("wIndentEntry"); gtk_entry_set_text(GTK_ENTRY(pW),sVal.utf8_str()); sVal = getTOCPropVal("toc-label-inherits",getDetailsLevel()); pW = _getWidget("cbInherit"); if(g_ascii_strcasecmp(sVal.utf8_str(),"1") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pW),TRUE); } else { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pW),FALSE); } FV_View * pView = static_cast<FV_View *>(getActiveFrame()->getCurrentView()); sVal = getTOCPropVal("toc-label-type",getDetailsLevel()); pW = _getWidget("wLabelChoose"); GtkComboBox *combo = GTK_COMBO_BOX(pW); UT_sint32 iHist = static_cast<UT_sint32>(pView->getLayout()->FootnoteTypeFromString(sVal.utf8_str())); gtk_combo_box_set_active(combo,iHist); sVal = getTOCPropVal("toc-page-type",getDetailsLevel()); pW = _getWidget("wPageNumberingChoose"); combo = GTK_COMBO_BOX(pW); iHist = static_cast<UT_sint32>(pView->getLayout()->FootnoteTypeFromString(sVal.utf8_str())); gtk_combo_box_set_active(combo,iHist); sVal = getTOCPropVal("toc-tab-leader",getDetailsLevel()); pW = _getWidget("wTabLeaderChoose"); combo = GTK_COMBO_BOX(pW); if(g_ascii_strcasecmp(sVal.utf8_str(),"none") == 0) { iHist = 0; } else if(g_ascii_strcasecmp(sVal.utf8_str(),"dot") == 0) { iHist = 1; } else if(g_ascii_strcasecmp(sVal.utf8_str(),"hyphen") == 0) { iHist = 2; } else if(g_ascii_strcasecmp(sVal.utf8_str(),"underline") == 0) { iHist = 3; } else { iHist = 1; } gtk_combo_box_set_active(combo,iHist); }
AV_View * AP_Dialog_Lists::getAvView(void) { XAP_Frame * pFrame = getActiveFrame(); return pFrame->getCurrentView(); }