Abiword文檔對象初始化
新建或開發文檔
- PD_Document類的實例化
如果是新建文檔,調用PD_Document::newDocument函數創建新文檔,或則調用PD_Document::readFromFile打開一個文檔。
- pt_PieceTable類的實例化,通過該類初始化文檔的物理存儲架構。也就是PieceTable數據結構的實現
- pf_Frag_Strux_Section類,該類實例化后放入pf_Fragments中。
- pf_Frag_Strux_Block 類,同樣放入pf_Fragments中。
- pf_Frag 類,實例化pf_Frag::PFT_EndOfDoc的對象,表示文檔結尾的片段。
- AP_Frame::_showDocument方法
- 調用_createViewGraphics函數創建:GR_Graphics對象,FL_DocLayout類的實例化
??? FL_DocLayout is a formatted representation of a specific PD_Document,?
??? formatted for a specific GR_Graphics context.?
- FV_View類的實例化,?調用AP_Frame::_replaceView函數
- FL_DocLayout::fillLayouts函數中,實例化 fl_DocListener 類
- PD_Document::addListener方法將 fl_DocListener 對象添加到文檔中
- pt_PieceTable::addListener, 循環pf_Fragments(鏈表數據結構)對象 ,初始化對應的布局類。
- fl_DocSectionLayout 類,該類對應pf_Frag_Strux_Section類,并且存儲這個類對象的指針
該類實例化后,被添加到FL_DocLayout中。
- each FL_DocLayout contains a list of fl_SectionLayout objects
- each fl_SectionLayout are composed of fl_BlockLayout objects
- fl_BlockLayout類,該類對應pf_Frag_Strux_Block ,并且存儲這個類對象的指針
Where each fl_BlockLayout corresponds to a logical element in
?the PD_Document (i.e., usually a paragraph of text).
在fl_BlockLayout::_insertEndOfParagraphRun函數中,初始化FL_DocLayout的物理結構。
- ?fp_EndOfParagraphRun類的實例化。
- fp_Line?類的實例化。
- FL_DocLayout::addNewPage函數初始化fp_Page類
- fp_Column 類實例化
- 調用fp_VerticalContainer::insertContainer函數把fp_Line?添加到fp_Column 類中。
- 把fp_EndOfParagraphRun對象添加到fp_Line?中
編輯文檔
- ?FV_View::_charInsert函數
-
FV_View::insertParaBreakIfNeededAtPos
??????? Insrts a block and returns true if the point is at the end of a?
??????? section or document and the previous strux is not a block??????if(!isParaBreakNeededAtPos(pos))
???? {
???????? return false;
?????}
???? m_pDoc->insertStrux(pos,PTX_Block);//如果需要就插入Block
???? return true; - ?PD_Document::insertSpan
???????? pt_PieceTable::_insertFmtMarkFragWithNotify, 實例化pf_Frag_FmtMark類、fp_FmtMarkRun類
???????? pt_PieceTable::insertSpan函數,實例化pf_Frag_Text
???????? 通過構建PX_ChangeRecord類,調用PD_Document::notifyListeners函數,通過fl_DocListener::change方法通知fmt層數據發生變化。
???????? 通過fl_SectionLayout,fl_BlockLayout::_doInsertTextSpan的方法,實例化fp_TextRun
?
- 增加新行時,實例化pf_Frag_Strux_Block、fl_BlockLayout、fp_EndOfParagraphRun、fp_Line
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
