<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="js-xpcom-overview.xsl" type="application/xml"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>urn:uuid:e83f5eea-de16-4230-8cfc-f274d2d9395f</id>
  <title xml:lang="en">JavaScript XPCOM Overview</title>
  <author>
    <name xml:lang="en">nanto_vi (TOYAMA Nao)</name>
  </author>
  <updated>2007-06-15T01:10:00+09:00</updated>

  <entry>
    <id>urn:uuid:20635328-e68d-4a05-925b-dffc53cc3b1d</id>
    <title xml:lang="ja">自己紹介</title>
    <updated>2007-06-15T01:10:00+09:00</updated>
    <content type="xhtml" xml:lang="ja">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <ul>
          <li>nanto_vi (なんと)</li>
          <li>外山真 (とやまなお)</li>
          <li><a href="http://nanto.asablo.jp/blog/">Days on the Moon</a></li>
          <li><a href="http://twitter.com/nanto_vi">Twitter はじめました</a></li>
        </ul>
      </div>
    </content>
  </entry>

  <entry>
    <id>urn:uuid:76b81961-6107-4c61-8c35-4f0743b765ee</id>
    <title xml:lang="en">Enhanced Feed Preview</title>
    <updated>2007-06-15T01:10:00+09:00</updated>
    <content type="xhtml" xml:lang="ja">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <ul>
          <li><a href="https://addons.mozilla.org/ja/firefox/addon/4400" title="Enhanced Feed Preview">製作者スタイルシートでフィードを表示</a></li>
          <li><a href="http://a8i.blog78.fc2.com/blog-entry-19.html" title="あの不定記 Firefox 2 のフィードプレビューで XSLT が無視されてしまう">あさんによるスタイルシート適用方法が発端</a></li>
          <li><a href="http://d.hatena.ne.jp/nyama/20061031/1162230428" title="Another 朝顔日記 - Enhanced Feed Preview">のりさん提案の仕様</a></li>
        </ul>
      </div>
    </content>
  </entry>

  <entry>
    <id>urn:uuid:32b5faf8-bc8b-4dfd-9d95-350e1b9ab9d2</id>
    <title xml:lang="en">XPCOM</title>
    <updated>2007-06-15T01:10:00+09:00</updated>
    <content type="xhtml" xml:lang="ja">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <ul>
          <li xml:lang="en">Cross Platform Component Object Model</li>
          <li>裏方の操作を担う部品</li>
          <li>ファイル入出力、フォーマット変換、etc.</li>
        </ul>
        <pre><code>var comp = Components.classes[contractId]
                     .createInstance(iid);</code></pre>
      </div>
    </content>
  </entry>

  <entry>
    <id>urn:uuid:4ae8c968-7ead-4028-9e50-4d93effee690</id>
    <title xml:lang="ja">XPCOM コンポーネントの作成 (1)</title>
    <updated>2007-06-15T01:10:00+09:00</updated>
    <content type="xhtml" xml:lang="ja">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <ul>
          <li>インターフェースの定義 (何ができるか)</li>
          <li>xpidl で Firefox が理解できる形式に</li>
        </ul>
        <pre><code>[scriptable, uuid(...)]
interface myIFoo : nsISupports {
  AString sayHello();
};</code></pre>
      </div>
    </content>
  </entry>

  <entry>
    <id>urn:uuid:abd39e10-f1dd-4eb2-adfb-6615db5ffde6</id>
    <title xml:lang="ja">XPCOM コンポーネントの作成 (2)</title>
    <updated>2007-06-15T01:10:00+09:00</updated>
    <content type="xhtml" xml:lang="ja">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <ul>
          <li>実装 (どうやってするか)</li>
        </ul>
        <pre><code>function myFoo () {}
myFoo.prototype = {
  sayHello: function () {
    return "Hello world!";
  },
  QueryInterface: ...
};</code></pre>
      </div>
    </content>
  </entry>

  <entry>
    <id>urn:uuid:97db140d-f797-44d2-92f2-abcf19c19be8</id>
    <title xml:lang="ja">XPCOM コンポーネントの作成 (3)</title>
    <updated>2007-06-15T01:10:00+09:00</updated>
    <content type="xhtml" xml:lang="ja">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <ul>
          <li>ファクトリの作成</li>
        </ul>
        <pre><code>var myFooFactory = {
  createInstance: function (...) {
    ...
    return new myFoo().QueryInterface(...);
  }
};</code></pre>
      </div>
    </content>
  </entry>

  <entry>
    <id>urn:uuid:b38748f1-08ab-4a22-b066-18e25b613ad7</id>
    <title xml:lang="ja">XPCOM コンポーネントの作成 (4)</title>
    <updated>2007-06-15T01:10:00+09:00</updated>
    <content type="xhtml" xml:lang="ja">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <ul>
          <li>コンポーネントの登録</li>
          <li>contract id, class id: 実装を識別</li>
        </ul>
        <pre><code>var myFooModule = {
  registerSelf: ...,
  getClassObject: function (...) {
    return myFooFactory;
  }
};</code></pre>
      </div>
    </content>
  </entry>

  <entry>
    <id>urn:uuid:a96c4264-99e8-4402-bddf-86c3503d776b</id>
    <title xml:lang="ja">コンポーネントの置換</title>
    <updated>2007-06-15T01:10:00+09:00</updated>
    <content type="xhtml" xml:lang="ja">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <ul>
          <li>新たなインターフェースの定義は不要</li>
          <li>registerSelf で新しく作った実装を登録する際、置換する contract id を用いる</li>
          <li>Trunk では反映されない場合がある?
            <ul>
              <li>起動時に毎回登録 (Enhanced Feed Preview)</li>
            </ul>
          </li>
        </ul>
        <pre><code>Components.manager
          .QueryInterface(nsIComponentRegistrar)
          .registerFactoryLocation(...);</code></pre>
      </div>
    </content>
  </entry>

  <entry>
    <id>urn:uuid:5734a0ec-e40a-4e12-9950-bec2fec97bda</id>
    <title xml:lang="ja">参考資料</title>
    <updated>2007-06-15T01:10:00+09:00</updated>
    <content type="xhtml" xml:lang="ja">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <ul>
          <li><a href="http://developer.mozilla.org/ja/docs/How_to_Build_an_XPCOM_Component_in_Javascript" xml:lang="en" hreflang="en">How to Build an XPCOM Component in Javascript - MDC</a></li>
          <li><a href="http://firefox.geckodev.org/index.php?XPCOM%E3%81%AE%E4%BD%9C%E6%88%90">XPCOM の作成 - Mozilla Firefox まとめサイト</a></li>
          <li><a href="http://nanto.asablo.jp/blog/2005/06/13/20665">JavaScript で XPCOM を作る: Days on the Moon (古い情報)</a></li>
        </ul>
      </div>
    </content>
  </entry>
</feed>
