このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。

翻訳前ページへ


Plugins for VCL
Language

The 解放する/自由な and Open 生産性 控訴
解放(する)d: Apache OpenOffice 4.1.16

Plugins for VCL

事業/計画(する) Owner: Philipp Lohmann, last change: 2004/01/28


現在/一般に only 利用できる for Unix 壇・綱領・公約s: plugins move the whole 壇・綱領・公約 扶養家族 part of VCL(Unix) into an own library. At runtime OOo decides what plugin would 控訴 the 現在の desktop 環境 best; e.g. it uses a gtk based plugin on GNOME desktops or a generic (plain Xlib based) plugin on CDE. The 創立/基礎 for this the pure abstraction of all Sal interfaces (Sal: System Abstraction 層 – the 指名する is sadly coincidental with the sal 事業/計画(する); the Sal 層 in vcl 存在するd first 歴史的に).

Why plugins ?

For better system 統合,差別撤廃 it is necessary to run the system's toolkit inside the OOo 過程 space. E.g. to use toolkit 主題s for 製図/抽選 支配(する)/統制するs it is imperative to be able to ask the native toolkit to draw OOo's 支配(する)/統制するs. Also toolkits know how to 接近 system features like 最近の 文書 名簿(に載せる)/表(にあげる)s, とじ込み/提出する 対話s, etc..

What are the basics for 令状ing a VCL(Unix) plugin ?

The starting point for a new VCL plugin is SalInstance. This is a factory interface the 実施 of which produces instances of all other Sal interfaces. At startup the 独立した・無所属 part of vcl tries to 決定する the 訂正する plugin (desktop autodetection) and then tries to 負担 that library and ask it for a SalInstance 反対する. Every other Sal interface implentation is produced 経由で the corresponding method of SalInstance (see vcl/inc/salinst.hxx for 詳細(に述べる)s).

SalInstance

The first step is to create an extern "C" 機能(する)/行事 指名するd create_SalInstance which returns the SalInstance of your plugin. For many plugins it is advantageous to 相続する their SalInstance from the SalInstance of the generic 実施 so the new plugin can 再使用する the generic 実施 where appropriate; good examples for 実施s that can be 相続するd are SalSound, SalBitmap, SalGraphics and SalPrinter. 特に SalGraphics should be used from the generic 実施 as it 含む/封じ込めるs really difficult stuff like 製図/抽選 text with コンビナート/複合体 text layout (CTL) that would be a real 苦痛 to 器具/実施する with little 伸び(る) since the result should still look like the result of the generic SalGraphics. Still, if you want to 器具/実施する every Sal interface on your own there is of course nothing to stop you from doing that.

SalInstance is also 責任がある the 使用/適用 main 宙返り飛行 and the SolarMutex (the mutex vcl gets its thread 認識/意識性 from). Since toolkits tend to be nonfunctional without their own main 宙返り飛行, this is the first feature you should 器具/実施する. The methods GetYieldMutex, ReleaseYieldMutex and AcquireYieldMutex must return a vos::IMutex interface (see vos/inc/vos/mutex.hxx) that synchronizes to the mutex of your special toolkit. Then 産する/生じる must be 器具/実施するd. 産する/生じる is VCL's interface to the system main 宙返り飛行; when called it should look for all 肉親,親類d of events (e.g. X events) and 派遣(する) them 適切な. If called with parameter bWait 始める,決める to TRUE it should wait until an event is 利用できる and then 派遣(する) it. If bWait is FALSE 産する/生じる should 派遣(する) all events already 利用できる and then return すぐに.

Please 公式文書,認める that this may be far from trivial to 器具/実施する depending on your toolkit since so much depends on the main 宙返り飛行. Unless you 器具/実施する every Sal interface yourself it is 基本的に necessary to 相続する from the SalDisplay, SalXLib and SalData classes of the generic 実施 since these lay the 基礎 for most other generic 実施s (X11SalFrame, X11SalTimer, etc.). E.g. SalData 追加するs とじ込み/提出する descriptors to be watched for events in the main 宙返り飛行. To make this feasible the corresponding methods on the SalXLib, SalData and SalDisplay are 事実上の so a new 実施 can overload these and still use the generic 実施.

SalFrame

The next step is most likely 器具/実施するing the SalFrame interface. This is necessary for the に引き続いて 推論する/理由s:

When 器具/実施するing SalFrame you must 打ち勝つ the に引き続いて problems:

SalObjects

If you have 器具/実施するd SalFrame, you'll need to 器具/実施する SalObject, too. SalObject is a child window of a SalFrame 保証(人)d to be a native system window (that is in Xtoolkit 条件 a widget rather than a gadget). This is needed for plugins and java applets inside 文書s. There are only two 障害s doing this as SalObject is really rather boring:

General considerations

While 器具/実施するing your own plugin you may find it necessary to change something inside the generic plugin. Please do so if it 控訴s you, but 接触する one of the vcl team (e.g. The author of this 文書) to check whether your change does not break anything for other 実施s.

In general it may be a good idea to 接触する the vcl developers before and during the 実施 on the dev@gsl.openoffice.org mailinglist as all 肉親,親類d of questions may arise (特に considering that VCL is 大部分は undocumented code up today).

The ASF

Copyright & License | Privacy | 接触する Us | 寄付する | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are 登録(する)d trademarks of The Apache ソフトウェア 創立/基礎. The ASF logo is a trademark of The Apache ソフトウェア 創立/基礎. Other 指名するs appearing on the 場所/位置 may be trademarks of their 各々の owners.