IT翻訳 Nobuyuki の仕事部屋

ボランティアでソフトウエアーローカライズのために翻訳をしている。

Mozilla DOM Hacking Guide: Introduction to XPCOM11

2006-01-20 23:25:36 | InDraft
今日胃カメラを飲んだ。
モニタに映った自分の胃壁を見るのはなかなか面白い。カメラを飲むのは苦痛であるが、ドクターが”今食道を下っている”とか”これから胃に入る”とか解説をしてくれるので、ふむふむという感じでモニタを見つめていた。しわしわの胃の内部が、普段見慣れない奇妙な生命の形としてそこに写し出されていた。

”胃炎で胃の中がボヤっとしているが、大きな問題はない。”との診断。喜んでいいのか悲しむべきか。fatal な状態でないのでとりあえずやれやれ。胃薬をもらった。

夜テレビで、剣を飲む男が出ていた。中国人の男が、天を仰ぎながら腸まで達しそうな長さの剣を口から飲み込んでいた。”健康診断のため胃カメラを飲みなさい”とつぶやいた。 (^^;

-----------------------------------------------

原文:  青色表示
訳文:  黒色表示
注記/訂正: 赤色表示

E. Tutorial : How to add a new interface
E.a. Introduction


E. Tutorial : 新しいインターフェイスの追加方法
E.a. 始めに


The purpose of this tutorial is to describe the process of adding a new interface to the DOM and then implementing it. A good understanding of the previous sections is preferred to understand this tutorial. You could want to add a new interface for several reasons, like the addition of a new DOM object, or to respect an eventual "Interface freeze". First we will take a look at XPIDL and how it can help you define interfaces. Next we will describe the build system, makefiles, etc... And finally, we will look at the implementation of our new interface through the creation of an nsIDOMFabian interface (Fabian is my first name ;-).

このチュートリアルの目的は、DOM に新しいインターフェイスを追加しそれを実装する方法を解説することです。チュートリアルを理解するために前節をよく理解することが推奨されます。新しいインターフェイスを追加したくなるのにはいくつかの理由があります。新しい DOM のオブジェクトを追加したり、最終的な”インターフェイスの凍結”を順守するためです。最初に XPIDL を調べて、それがどのようにインターフェイスの定義を支援可能か見てみましょう。次にビルドシステム、makefiles、などを解説します。最後に、nsIDOMFabian インターフェイス(Fabian は私の名前なのですが ;-)を通じてこれらの*1新しいインターフェイスの実装を観てみましょう。

*1→our new interface を”私たちの新しいインターフェイス”と直訳せずに”これらの・・・・”としました。なぜ"our"を使うのでしょうか?"our"とは writer と reders を言っているのでしょうか?、それともおそらく Mozilla community (=Mozillaを支援する有志の集まり)を指しているのでしょう。とすれば、この場合直訳も可能かもしれません。次の段落にもこの"our" が出てきます

E.b. XPIDL

XPIDL stands for Cross-Platform Interface Definition Language. Instead of coding interfaces directly in C++, one can use XPIDL. It simplifies greatly the task of defining interfaces, and offers some interesting features, like automatic generation of documentation, and XPT generation. The first thing to do is to decide what our interface, nsIDOMFabian, will do. For the purpose of this document, I have chosen to implement a new HTML interface called nsIDOMFabian. It will be implemented by the class nsHTMLDocument.


XPIDL は Cross-Platform Interface Definition Language の頭文字です。 C++ でインターフェイスを直接コーディングせずに、 XPIDL を使うことが可能です。それを使用するとインターフェイスの定義のタスクを簡略化し、文書の自動生成や XPT の生成などの面白い機能をいくつか提供します。最初にするべきことは、私たちのインターフェイスである nsIDOMFabian が何をするか決めます。この文書のために、私は nsIDOMFabian という新しい HTML インターフェイスを実装することを選択しました。そのインターフェイスは nsHTMLDocument クラスによって実装されます。

この後、コーディングのサンプルが延々と続きます。長くなるので、ここで切って続きは次回にしましょう。
See you tomorrow! (^-^)/~~~~