diff options
Diffstat (limited to 'files/ja/xpconnect')
-rw-r--r-- | files/ja/xpconnect/appshellservice/index.html | 23 | ||||
-rw-r--r-- | files/ja/xpconnect/architecture_basics/index.html | 16 | ||||
-rw-r--r-- | files/ja/xpconnect/index.html | 63 | ||||
-rw-r--r-- | files/ja/xpconnect/nsiprofile/index.html | 11 | ||||
-rw-r--r-- | files/ja/xpconnect/nsiregistry/index.html | 87 | ||||
-rw-r--r-- | files/ja/xpconnect/using_components/index.html | 94 | ||||
-rw-r--r-- | files/ja/xpconnect/xpconnect_wrappers/index.html | 36 |
7 files changed, 0 insertions, 330 deletions
diff --git a/files/ja/xpconnect/appshellservice/index.html b/files/ja/xpconnect/appshellservice/index.html deleted file mode 100644 index 32239b17d1..0000000000 --- a/files/ja/xpconnect/appshellservice/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: appShellService -slug: XPConnect/appShellService -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_bindings/XPConnect/appShellService ---- -<p>Mozilla を終了する:</p> - -<pre class="eval notranslate">var Cc = Components.classes; -var Ci = Components.interfaces; -shell = Cc["@mozilla.org/appshell/appShellService;1"]; -shell = shell.getService(Ci.nsIAppShellService); -shell.quit(3); // eForceQuit -</pre> - -<p>バン! Mozilla が消えます。</p> - -<p>次に、もっと簡単な方法があります; <a href="en/Xpcshell">xpcshell</a> <a class="external" href="http://www.mozilla.org/scriptable/XPCShell.html">拡張機能</a> の一つは quit 関数です:</p> - -<pre class="eval notranslate">quit(3) -</pre> diff --git a/files/ja/xpconnect/architecture_basics/index.html b/files/ja/xpconnect/architecture_basics/index.html deleted file mode 100644 index dcd70646fe..0000000000 --- a/files/ja/xpconnect/architecture_basics/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Architecture basics -slug: XPConnect/Architecture_basics -tags: - - Guide - - NeedsContent - - XPCOM - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_bindings/XPConnect/Architecture_basics ---- -<p><strong>XPCOM</strong> は <a class="external" href="http://en.wikipedia.org/wiki/Component_Object_Model">Windows の COM</a> に似ています。 Mozilla 内のコンポーネントへのポインタを取得でき、それらのインターフェイスについても説明できます。</p> - -<p><strong>XPConnect</strong> は、 <a href="/en-US/JavaScript">JavaScript</a> が XPCOM システムである Mozilla guts と通信できるようにするものです。 JavaScript コードと Mozilla guts との間の架け橋のように想像できます。</p> - -<p><a href="/en-US/docs/xpcshell">xpcshell</a> は、 Mozilla JavaScript へのコマンドラインインターフェイスです。これはインタラクティブなインタープリターです。 -- JavaScript の XPConnect ブリッジを介して Mozilla と直接通信するシェルを提供します。</p> diff --git a/files/ja/xpconnect/index.html b/files/ja/xpconnect/index.html deleted file mode 100644 index c136996efe..0000000000 --- a/files/ja/xpconnect/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: XPConnect -slug: XPConnect -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_bindings/XPConnect ---- -<p> -</p> -<div> -<p>XPConnect は、<a href="ja/JavaScript">JavaScript</a> と <a href="ja/XPCOM">XPCOM</a> の間のブリッジです。XPConnect を使うと、JavaScript のコードから XPCOM コンポーネントを、また、XPCOM コンポーネントからその範囲内で JavaScript オブジェクトも相互に使えます。 -</p> -</div> -<table class="topicpage-table"> -<tbody><tr><td> -<h4 id=".E3.83.89.E3.82.AD.E3.83.A5.E3.83.A1.E3.83.B3.E3.83.88" name=".E3.83.89.E3.82.AD.E3.83.A5.E3.83.A1.E3.83.B3.E3.83.88"> <a>ドキュメント</a> </h4> -<dl><dt> <a href="ja/XPConnect/Architecture_basics">構造の基本</a> -</dt><dd> <small>XPConnect、JavaScript、XPCOM、XUL...</small> -</dd></dl> -<dl><dt> <a href="ja/XPConnect/Using_components">コンポーネントの使い方</a> -</dt><dd> <small>XPCOM コンポーネントとやりとりする方法。</small> -</dd></dl> -<dl><dt> <a class="external" href="http://www.mozilla.org/scriptable/faq.html">XPConnect と XPIDL に関する FAQ</a> -</dt></dl> -<dl><dt> <a href="ja/XPConnect_wrappers">ラッパー</a> -</dt><dd> <small>XPCOM が生成し使用するラッパーとはどのようなものか。</small> -</dd></dl> -<p><span class="alllinks"><a>すべて見る...</a></span> -</p> -<h4 id=".E3.82.B5.E3.83.B3.E3.83.97.E3.83.AB" name=".E3.82.B5.E3.83.B3.E3.83.97.E3.83.AB"> サンプル </h4> -<dl><dt> <a href="ja/NsIEnumerator">nsIEnumerator</a> -</dt><dd> <small>{{ 訳語("列挙", "enumerating") }}が終わったタイミングをどのようにして知るか。</small> -</dd></dl> -<dl><dt> <a href="ja/XPConnect/nsIRegistry">nsIRegistry</a> -</dt><dd> <small><a href="ja/Appreg">appreg</a> の代理。</small> -</dd></dl> -<dl><dt> <a href="ja/XPConnect/nsIProfile">nsIProfile</a> -</dt><dd> <small>プロファイルの作成、リネーム、削除、一覧。</small> -</dd></dl> -<dl><dt> <a href="ja/XPConnect/appShellService">appShellService</a> -</dt><dd> <small>Mozilla を終了させる方法。</small> -</dd></dl> -<p><span class="alllinks"><a>すべて見る...</a></span> -</p> -</td> -<td> -<h4 id=".E3.82.B3.E3.83.9F.E3.83.A5.E3.83.8B.E3.83.86.E3.82.A3" name=".E3.82.B3.E3.83.9F.E3.83.A5.E3.83.8B.E3.83.86.E3.82.A3"> コミュニティ </h4> -<ul><li> Mozilla フォーラムを見る... -</li></ul> -<p>{{ DiscussionList("dev-tech-xpcom", "mozilla.dev.tech.xpcom") }} -</p> -<h4 id=".E3.83.84.E3.83.BC.E3.83.AB" name=".E3.83.84.E3.83.BC.E3.83.AB"> ツール </h4> -<ul><li> <a href="ja/Xpcshell">xpcshell</a> -</li></ul> -<h4 id=".E9.96.A2.E9.80.A3.E9.A0.85.E7.9B.AE" name=".E9.96.A2.E9.80.A3.E9.A0.85.E7.9B.AE"> 関連項目 </h4> -<dl><dd> <a href="ja/XPCOM">XPCOM</a>, <a href="ja/JavaScript">JavaScript</a>, <a href="ja/XPIDL">XPIDL</a> -</dd></dl> -</td></tr></tbody></table> -<p><span class="comment">Categories</span> -</p><p><span class="comment">Interwiki Language Links</span> -</p><p><br> -</p>{{ languages( { "en": "en/XPConnect", "fr": "fr/XPConnect", "ko": "ko/XPConnect", "pl": "pl/XPConnect" } ) }} diff --git a/files/ja/xpconnect/nsiprofile/index.html b/files/ja/xpconnect/nsiprofile/index.html deleted file mode 100644 index 54812d8c99..0000000000 --- a/files/ja/xpconnect/nsiprofile/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: nsIProfile -slug: XPConnect/nsIProfile -tags: - - Interfaces - - XPCOM - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_bindings/XPConnect/nsIProfile ---- -<p>このインターフェイスは廃止されました; 代わりに <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIToolkitProfileService" title="">nsIToolkitProfileService</a></code> を使用して下さい; ただし、古いコードを使用している場合は、 <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProfile" title="">nsIProfile</a></code> のリファレンスドキュメントを利用できます。</p> diff --git a/files/ja/xpconnect/nsiregistry/index.html b/files/ja/xpconnect/nsiregistry/index.html deleted file mode 100644 index 0772c7d794..0000000000 --- a/files/ja/xpconnect/nsiregistry/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: nsIRegistry -slug: XPConnect/nsIRegistry -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_bindings/XPConnect/nsIRegistry ---- -<div class="blockIndicator obsolete obsoleteHeader"> -<p><strong>廃止</strong><br> - この機能は廃止されました。一部のブラウザーでは引き続き機能する可能性がありますが、いつでも削除できるため使用は推奨されません。使用はしないようにして下さい。</p> -</div> - - - -<p>MXR の <a class="external" href="http://mxr.mozilla.org/mozilla-central/source/xpcom/obsolete/nsIRegistry.idl#45" title="http://mxr.mozilla.org/mozilla-central/source/xpcom/obsolete/nsIRegistry.idl#45">nsIRegistry</a></p> - -<p>その他のドキュメント: <a class="external" href="http://lxr.mozilla.org/mozilla/source/modules/libreg">libreg source</a>, <a class="external" href="http://lxr.mozilla.org/mozilla/source/modules/libreg/src/reg.h">reg.h in particular</a></p> - -<p>はい!</p> - -<p><a href="/en/Appreg" title="en/Appreg">appreg</a>.</p> - -<p>それはこのように動作します。</p> - -<pre class="eval notranslate">var Cc = Components.classes; -var Ci = Components.interfaces; -var rc = Cc["@mozilla.org/registry;1"]; -var rs = rc.getService(Ci.nsIRegistry); -</pre> - -<p>これでレジストリサービスが作成されました。</p> - -<pre class="eval notranslate">rs.openWellKnownRegistry(2); // 2 signifies the ApplicationRegistry, if I understand right -var st = rs.enumerateAllSubtrees(2); // 2 signifies "common", see libreg source (reg.h) for info -</pre> - -<p>これでサブツリーを報告できる <a href="/en/XPCOM_Interface_Reference/nsIEnumerator" title="en/nsIEnumerator">nsIEnumerator</a> ができました。</p> - -<pre class="eval notranslate">try { - st.first(); - do { - var data = st.currentItem(); - if( data instanceof Ci.nsIRegistryNode ) - print("nsIRegistryNode: " + data.nameUTF8 + " (" + data.key + ")"); - st.next(); - } while( Components.lastResult == 0 ); -} catch(e) {} -</pre> - -<p>これで、出力は次のようになります:</p> - -<pre class="eval notranslate">Profiles (344) -Profiles/default (530) -Profiles/foo (1046) -Profiles/bar (1518) -</pre> - -<p>カッコ内の数字は "Key" です。この Key は、残りの nsIRegistry API で使用できます( <a class="external" href="http://mxr.mozilla.org/mozilla-central/source/xpcom/obsolete/nsIRegistry.idl#45" title="http://mxr.mozilla.org/mozilla-central/source/xpcom/obsolete/nsIRegistry.idl#45">MXR</a> を参照)。</p> - -<p>今、私は外観検査から、各プロファイルに "directory" と呼ばれる Key があることを知っています。他の Key を自動的に取得する方法は分かりませんが、特定のプロファイルの directory を検索する方法は分かり<em>ます</em>。</p> - -<pre class="eval notranslate">js> rs.getStringUTF8(530, "directory") // 530: Profiles/default に対応する key -</pre> - -<p>出力は次のようになります:</p> - -<pre class="eval notranslate">/home/lion/.mozilla/default/awp83kud.slt -</pre> - -<p>やったー!</p> - -<p>これを変更するには?</p> - -<pre class="eval notranslate">js> rs.setStringUTF8(530, "directory", "/home/lion/somewhere/else") -js> rs.getStringUTF8(530, "directory") -/home/lion/somewhere/else -</pre> - -<p>はい!</p> - -<p>さて、唯一の問題は:<em>どう保存するのでしょうか?</em></p> - -<pre class="eval notranslate">js> rs.flush() // これは足りない... -</pre> - -<p>おそらく、 <a href="/en/XPConnect/appShellService" title="en/XPConnect/appShellService">XPConnect:appShellService</a> で終了すると機能します。</p> diff --git a/files/ja/xpconnect/using_components/index.html b/files/ja/xpconnect/using_components/index.html deleted file mode 100644 index c092429a01..0000000000 --- a/files/ja/xpconnect/using_components/index.html +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: Using components -slug: XPConnect/Using_components -tags: - - Deprecated - - Guide - - NeedsContent - - XPCOM - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_bindings/XPConnect/Using_components ---- -<p><a href="/en-US/docs/XPConnect">XPConnect</a> は、 Mozilla および <a href="/en-US/docs/XPConnect/xpcshell">xpcshell</a> で透過的に動作し、 <a href="/en-US/docs/XPCOM">XPCOM</a> コンポーネントへのアクセスを提供します。</p> - -<p>通常、スクリプトは次のように開始します:</p> - -<pre class="eval notranslate">var Cc = <a href="/en-US/docs/Components.classes">Components.classes</a>; -var Ci = <a href="/en-US/docs/Components.interfaces">Components.interfaces</a>; -</pre> - -<p>コンポーネントを取得したい場合は、次のようにします:</p> - -<pre class="eval notranslate">var rc = Cc["@mozilla.org/registry;1"]; -var rs = rc.getService(Ci.nsIRegistry); -</pre> - -<hr> -<p>関連項目:</p> - -<ul> - <li><a href="/en-US/docs/XPConnect/xpcshell">xpcshell</a> -- JavaScript へのコマンドラインインターフェイスを取得する方法</li> -</ul> - -<h2 id="より詳しい情報">より詳しい情報</h2> - -<p>既に述べたように、次のようなアドオンスクリプトを開始するのが一般的です:</p> - -<pre class="eval notranslate">var Cc = <a href="/en-US/docs/Components.classes">Components.classes</a>; -var Ci = <a href="/en-US/docs/Components.interfaces">Components.interfaces</a>; -</pre> - -<p>開始する別の方法もあります。これは上記と全く同じです.</p> - -<pre class="eval notranslate">var {Cc: classes, Ci: interfaces} = Components; -</pre> - -<p>クラスとインターフェイスだけではありません。</p> - -<pre class="eval notranslate">var { - Cu: utils, - Ci: interfaces, - Cc: classes, - Cr: results, - Cs: stack, - Cm: manager, - Ce: Exception, -} = Components; -</pre> - -<p>以下は、コンポーネントに含まれる内容の詳細です。 以下のいずれにも Components.BLAH (IE: Components.isSuccessCode) からアクセスできます。</p> - -<pre class="eval notranslate">utils=[object nsXPCComponents_Utils] -interfaces=[object nsXPCComponents_Interfaces] -classes=[object nsXPCComponents_Classes] -results=[object nsXPCComponents_Results] -isSuccessCode=function isSuccessCode() { -[native code] -} -Constructor=[object nsXPCComponents_Constructor] -QueryInterface=function QueryInterface() { -[native code] -} -interfacesByID=[object nsXPCComponents_InterfacesByID] -classesByID=[object nsXPCComponents_ClassesByID] -stack=JS frame :: Scratchpad/4 :: cDump :: line 8 -manager=[xpconnect wrapped nsIComponentManager] -ID=[object nsXPCComponents_ID] -Exception=[object nsXPCComponents_Exception] -reportError=function reportError() { -[native code] -} -canCreateWrapper=function canCreateWrapper() { -[native code] -} -canCallMethod=function canCallMethod() { -[native code] -} -canGetProperty=function canGetProperty() { -[native code] -} -canSetProperty=function canSetProperty() { -[native code] -} -</pre> diff --git a/files/ja/xpconnect/xpconnect_wrappers/index.html b/files/ja/xpconnect/xpconnect_wrappers/index.html deleted file mode 100644 index 3d8bee5d46..0000000000 --- a/files/ja/xpconnect/xpconnect_wrappers/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: XPConnect ラッパー -slug: XPConnect/XPConnect_wrappers -translation_of: Mozilla/Tech/XPCOM/Language_bindings/XPConnect/XPConnect_wrappers ---- -<p>このドキュメントは、<a href="/ja/docs/Mozilla/Tech/XPCOM/Language_bindings/XPConnect">XPConnect</a> ラッパーオブジェクトの概要を説明しています (技術的な説明については、<a href="/ja/docs/Mozilla/Gecko/Script_security">XPConnect セキュリティの層</a>を参照してください)。ラッパーの処理に関する実用的なアドバイスについては、<a href="/ja/docs/Mozilla/Tech/Xray_vision">chrome からコンテンツ DOM に安全にアクセスする</a>を参照してください。</p> - -<p>開発者は XPConnect でラッパーが大きな役割を果たしていることを理解しています。あまり知らされていない開発者は、ラッパーが存在し、何らかの重要性を持っていることを理解していますが、いつラッパーを使用すべきか、ラッパーを見なければならないかはわかりません。</p> - -<div class="note"><strong>Note:</strong> Wrappers can appear in the console log; for example "[object XrayWrapper [object blah]]". Because these are wrapped, you won't be able to peek down inside them from the console.</div> - -<h2 id="XPConnect_オブジェクトの基本">XPConnect オブジェクトの基本</h2> - -<h3 id="XPCWrappedNative">XPCWrappedNative</h3> - -<p>These objects are created when any natively implemented XPCOM object (that is, any object implemented in C++) needs to be reflected into JavaScript. This includes all DOM objects (including <code>Window</code>) and chrome elements that are reflected into JavaScript.</p> - -<p>This wrapper is responsible for mapping calls <em>from</em> JavaScript <em>into</em> C++. This means that when you say <code>window.focus()</code>, you're calling into XPCWrappedNative code.</p> - -<p>If you call '<code>toString()</code>' and get "<code>[xpconnect wrapped nsIFoo]</code>" then the reference is to a <code>XPCWrappedNative</code> object with interface <code>nsIFoo</code>.</p> - -<p>They are implicitly created by XPConnect and you should not have to worry about how that happens. There are several types of wrapped natives, but I won't cover those here.</p> - -<h3 id="XPCWrappedJS">XPCWrappedJS</h3> - -<p>These objects are the exact opposite of XPCWrappedNative. They exist to reflect an object <em>from</em> JavaScript <em>into</em> C++. This means that whenever you pass your JavaScript object into a C++ function, we create one of these wrappers. For example, if you've implemented some component with an interface <code>nsIFoo</code> and you pass your JavaScript object into a C++ function taking an <code>nsIFoo</code>, an XPCWrappedJS is created around your object. C++ calls are routed through XPCWrappedJS code into your JavaScript implementation.</p> - -<p>These wrappers are created by XPConnect, so you should not have to worry about how to construct them or whether to construct them.</p> - -<p><strong>Double wrapping.</strong> There is one case where an XPCWrappedNative wraps another wrapper object. This case is where a JS object was passed in via some IDL-declared interface, creating an XPCWrappedJS, and is now being returned to JavaScript via some other interface. In order to preserve API compatibility, an XPCWrappedNative is created around the XPCWrappedJS.</p> - -<h2 id="chrome_にさらされたセキュリティラッパー">chrome にさらされたセキュリティラッパー</h2> - -<p>To learn about security wrappers, see the article on <a href="/en-US/docs/Mozilla/Gecko/Script_security">script security in Gecko</a>.</p> - -<p>Note that a previous version of the current page recommended using <code>__exposedProps__</code> to expose objects from chrome to content. This is now deprecated and we are in the process of removing support for it. If you need to make objects or functions defined in chrome code accessible to content, use <a href="/en-US/docs/Components.utils.cloneInto">Components.utils.cloneInto</a> or <a href="/en-US/docs/Components.utils.exportFunction">Components.utils.exportFunction</a>.</p> |