It provides a number of largely platform independent widgets from which to construct a UI. Netscape and Mozilla both use XUL for their interfaces, but not all embedders chose to use it.
XUL はユーザーインターフェースをつくるために、数多く、大部分の OS 環境の独立した装置を提供します。Netscape と Mozilla は両方ともインターフェースに XUL を使用しています。しかし、Gecko を組み込む人たち全員が、それを使用するよう選ぶ必要はありません。
C 言語の知識が絶対必要とまではいかなくとも、基本的なプログラミングの知識がないとかなり厳しいですね。私も C は一度練習で扱っただけで詳しくありませんので識者の降臨とは言えませんが、みてみます。
…要点だけ短くコメントさせてもらおうかと思いましたが、部分的に拾っていたら逆に分かりにくくなりそうですし、結構面白そうな文章なので、勢いに任せて好き勝手に全訳してみます。(^^;
Quote:
Web browsing typically involves a large amount of string manipulation. Mozilla has developed a hierarchy of C++ classes to facilitate such manipulation and to render it efficient and quick. To make communication among objects simpler and more error free, Mozilla uses interfaces, which are, in essence, abstract classes.
Web ブラウジングは概して大量の文字列操作を必要とします。 Mozilla ではそういった操作やそれを効率的に素早く描画するのを助ける C++ のクラス階層を開発しています。オブジェクト間のやり取りを単純化しエラーを無くすため、Mozilla はインターフェイス、要するに抽象クラスを利用しています。
オブジェクト間のやり取りについては "Message: メッセージ" という専門用語がありますので、ここではちゃんと日本語化して良いかと。
"in essence: 本質的に" とすると何か違和感があります。インターフェイス(という機能)の実装が抽象クラス。
Quote:
The string hierarchy is also headed up by a set of abstract classes, nsAString, nsASingleFragmentString, and nsAFlatString, and for the same reasons. (These refer to double-byte strings. There is a parallel hierarchy topped with nsACString, etc., that refers to single-byte strings.)
プログラムで refer といえば普通 "参照する" ですね。 (referrence: 参照)
"parallel: 平行" とすると、階層なのに平行とかちょっと分かりにくいですね。ダブルバイトのものとシングルバイトのものが一対一対応するという意味です。 c.f. parallel world
etc. が訳から消えてますが、"同様の階層" という中に思いを込めたってことで。(^^;
Quote:
nsAString guarantees only a string of characters. nsASingleFragmentString guarantees that the characters will be stored in a single buffer. nsAFlatString guarantees that the characters will be stored in a single null-terminated buffer.
While there are underlying concrete classes, in general it is best to use the most abstract type possible in a given situation. For example, concantenation can be done virtually, through the use of pointers, resulting in an nsAString that can be used like any other string. This saves the allocating and copying that would otherwise have to be done.
最初の nsISupports の方法、QueryInterface、はそれを正確にします:基本的には、私はこのオブジェクトはタイプ A である(インターフェース A をサポートしている)ということを知っているけれども、それはタイプ B でもある(インターフェース B をサポートしている)のではありませんか、とそれは尋ねます。
The first nsISupports method, QueryInterface, does exactly that: it asks, in effect, I know that this object is of type A (supports interface A) but is it also of type B (supports interface B)?
XPCOM は実際に例示するオブジェクトへの間接的な方法、コンポーネントマネージャーを使用しているので、そして同じオブジェクトへの - しばしば異なったインターフェースに縛りつけられた - 多様なポインタが存在できるから、要求者がそれらのポインタがポイントする全てのオブジェクトの現在の痕跡を保つのは、急速に難しくなってきているかもしれません。
Because XPCOM uses an indirect method, the Component Manager, to actually instantiate objects, and because multiple pointers to the same object - often bound to different interfaces - can exist, it can quickly become very difficult for callers to keep accurate track of all of the objects to which those pointers point.
nsISupport と AddRef と Release での残りの2つのメソッドは、この問題を処理するよう計画されています。
The other two methods in nsISupports, AddRef and Release, are designed to deal with this issue.
ポインタが発表されたその毎に、Addref はオブジェクトに要求されなければなりません、内部カウンタを増加しながら。
Every time a pointer is given out AddRef must be called on the object, incrementing an internal counter.
ポインタがリリースされる毎に Release が要求されなければなりません、その同じカウンタを減少しながら。
Every time a pointer is released, Release must be called, decrementing that same counter.
→ ポインタがリリースされるたびに Release が呼び出され、同じ内部カウンタを減らします。
Quote:
Object の創造
Object creation
→ オブジェクトの生成
Quote:
1つずつ起こるオブジェクトによって供給された限られた数の永続的なサービスは、コンポーネントマネージャーの仲間、サービスマネージャーによって作られて、支配されています。
A limited number of persistent services, supplied by singleton objects, are created and controlled by a companion to the Component Manager, the Service Manager.
もし一つの機能性が他のインターフェースをもまた実装するならば、全てのインターフェースによって共有された1つの機能性は、見るべきランタイムで、基礎的なオブジェクトに質問できます。
One functionality shared by all interfaces is the ability to query the underlying object at runtime to see if also implements other interfaces.
しかしながら時々、ちょうどのときに Addref と Release を要求するのを忘れずにすることでさえ難しいかもしれません。
Sometimes, however, even remembering to call AddRef and Release at the right times can be difficult.
nsAString guarantees only a string of characters. nsASingleFragmentString guarantees that the characters will be stored in a single buffer. nsAFlatString guarantees that the characters will be stored in a single null-terminated buffer.