LibreOffice(52)サービス辞書とインターフェイス辞書の結果を図に書く

2014-05-15

旧ブログ

t f B! P L

前の関連記事:LibreOffice(51)クラスにすると関数の引数が減らせた


とりあえずいまできているサービス辞書とインターフェイス辞書を出力してみてサービスとインターフェイスの継承図を作ってみます。

出力結果をみて手動でImpressで継承図を作成


継承図自体マクロで出力できるのかもしれないのですが、全然そんな力はないので結果をみて手動で継承図を作成してみました。

まずはサービス辞書とインターフェイス辞書だけを使ってサービスとインターフェイスの継承関係を出力します。(libreoffice52.py)

これで出力されたものを元に継承図を作成しています。

Writerドキュメントを開いた状態で実行したもの。
{'com.sun.star.text.TextDocument'}
com.sun.star.text.TextDocument ['com.sun.star.text.GenericTextDocument']
com.sun.star.text.GenericTextDocument ['com.sun.star.beans.XPropertySet', 'com.sun.star.lang.XMultiServiceFactory', 'com.sun.star.style.XStyleFamiliesSupplier', 'com.sun.star.text.XBookmarksSupplier', 'com.sun.star.text.XChapterNumberingSupplier', 'com.sun.star.text.XDocumentIndexesSupplier', 'com.sun.star.text.XEndnotesSupplier', 'com.sun.star.text.XFootnotesSupplier', 'com.sun.star.text.XPagePrintable', 'com.sun.star.text.XReferenceMarksSupplier', 'com.sun.star.text.XTextDocument', 'com.sun.star.text.XTextEmbeddedObjectsSupplier', 'com.sun.star.text.XTextFieldsSupplier', 'com.sun.star.text.XTextFramesSupplier', 'com.sun.star.text.XTextGraphicObjectsSupplier', 'com.sun.star.text.XTextSectionsSupplier', 'com.sun.star.text.XTextTablesSupplier', 'com.sun.star.util.XNumberFormatsSupplier', 'com.sun.star.util.XRefreshable', 'com.sun.star.util.XReplaceable', 'com.sun.star.util.XSearchable']
com.sun.star.text.XTextDocument ['com.sun.star.frame.XModel']
com.sun.star.util.XReplaceable ['com.sun.star.util.XSearchable']
com.sun.star.frame.XModel ['com.sun.star.lang.XComponent']
com.sun.star.text.GenericTextDocument ['com.sun.star.document.OfficeDocument']
com.sun.star.document.OfficeDocument ['com.sun.star.document.XDocumentEventBroadcaster', 'com.sun.star.document.XDocumentPropertiesSupplier', 'com.sun.star.document.XEmbeddedScripts', 'com.sun.star.document.XEventBroadcaster', 'com.sun.star.document.XEventsSupplier', 'com.sun.star.document.XUndoManagerSupplier', 'com.sun.star.document.XViewDataSupplier', 'com.sun.star.frame.XModel', 'com.sun.star.frame.XStorable', 'com.sun.star.util.XModifiable', 'com.sun.star.view.XPrintJobBroadcaster', 'com.sun.star.view.XPrintable']
com.sun.star.frame.XModel ['com.sun.star.lang.XComponent']
com.sun.star.util.XModifiable ['com.sun.star.util.XModifyBroadcaster']
青の矢印が出力順です。

②の矢印が③の長さまでのところで一旦中断して、③と⑤が連番になるようにしたいのですよね。

⑦も⑧と⑨のところで一旦中断させたいのです。

インターフェイスは多重継承ができるのでcom.sun.star.frame.XModelが2回でてきていますね。

そもそもすべての矢印の行き先はcom.sun.star.uno.XInterfaceに集約するのですがそれは辞書生成時に省いています。

Calcドキュメントを開いた状態で実行したもの。
{'com.sun.star.sheet.SpreadsheetDocument'}
com.sun.star.sheet.SpreadsheetDocument ['com.sun.star.document.XActionLockable', 'com.sun.star.document.XLinkTargetSupplier', 'com.sun.star.drawing.XDrawPagesSupplier', 'com.sun.star.frame.XModel', 'com.sun.star.lang.XMultiServiceFactory', 'com.sun.star.sheet.XCalculatable', 'com.sun.star.sheet.XConsolidatable', 'com.sun.star.sheet.XDocumentAuditing', 'com.sun.star.sheet.XGoalSeek', 'com.sun.star.sheet.XSpreadsheetDocument', 'com.sun.star.style.XStyleFamiliesSupplier', 'com.sun.star.util.XNumberFormatsSupplier', 'com.sun.star.util.XProtectable']
com.sun.star.frame.XModel ['com.sun.star.lang.XComponent']
com.sun.star.sheet.SpreadsheetDocument ['com.sun.star.document.OfficeDocument', 'com.sun.star.sheet.SpreadsheetDocumentSettings']
com.sun.star.document.OfficeDocument ['com.sun.star.document.XDocumentEventBroadcaster', 'com.sun.star.document.XDocumentPropertiesSupplier', 'com.sun.star.document.XEmbeddedScripts', 'com.sun.star.document.XEventBroadcaster', 'com.sun.star.document.XEventsSupplier', 'com.sun.star.document.XUndoManagerSupplier', 'com.sun.star.document.XViewDataSupplier', 'com.sun.star.frame.XModel', 'com.sun.star.frame.XStorable', 'com.sun.star.util.XModifiable', 'com.sun.star.view.XPrintJobBroadcaster', 'com.sun.star.view.XPrintable']
com.sun.star.sheet.SpreadsheetDocumentSettings ['com.sun.star.beans.XPropertySet']
com.sun.star.frame.XModel ['com.sun.star.lang.XComponent']
com.sun.star.util.XModifiable ['com.sun.star.util.XModifyBroadcaster']

これもcom.sun.star.frame.XModelが2回でてきていますね。

出力順は先ほどと同様になっています。

libreoffice52.pyで2行目をコメントアウトして3行目のコメントアウトをはずして今度はUNOオブジェクトがnew-styleサービスのときの結果をみてみます。
('com.sun.star.awt.Toolkit',)
com.sun.star.awt.Toolkit ['com.sun.star.awt.XToolkit2']
com.sun.star.awt.XToolkit2 ['com.sun.star.awt.XDataTransferProviderAccess', 'com.sun.star.awt.XExtendedToolkit', 'com.sun.star.awt.XMessageBoxFactory', 'com.sun.star.awt.XReschedule', 'com.sun.star.awt.XSystemChildFactory', 'com.sun.star.awt.XToolkit']
これは1階層しかないのでこのままでも問題はおきていないですね。

libreoffice52.pyで今度は4行目のコメントアウトをはずしてサービスがないUNOオブジェクトについてみてみます。
{'com.sun.star.uno.XComponentContext', 'com.sun.star.lang.XComponent', 'com.sun.star.container.XNameContainer'}
com.sun.star.container.XNameContainer ['com.sun.star.container.XNameReplace']
com.sun.star.container.XNameReplace ['com.sun.star.container.XNameAccess']
com.sun.star.container.XNameAccess ['com.sun.star.container.XElementAccess']
これは階層をもつものが1つしかないので順番の問題はおきていません。

次の関連記事:LibreOffice(53)オブジェクトがもつサービスとインターフェイスをpreorder(行きかけ順)に出力

ブログ検索 by Blogger

Translate

最近のコメント

Created by Calendar Gadget

QooQ