Revision 186490 of Empacotando Temas

  • Slug da revisão: Empacotando_Temas
  • Título da revisão: Empacotando Temas
  • ID da revisão: 186490
  • Criado:
  • Autor: Verruckt
  • É revisão atual? Não
  • Comentário /* Disposição do Arquivo de Tema */

Conteúdo da revisão

Este documento descreve como empacotar temas para o Firefox e o Thunderbird.

Pré Requisitos

Fazer um tema para o Firefox ou Thunderbird requer conhecimentos em Cascading Style Sheets (CSS), provavelmente XBL, e um pouco de design gráfico e habilidade estética (...ou talvez não). Este documento descreve somente como Temas são empacotados em ordem para serem mostrados na janela de Temas do Firefox.

Disposição do Arquivo de Tema

Os temas do Firefox/Thunderbird são empacotados em um arquivo JAR com a seguinte estrutura:

theme.jar:
  install.rdf
  contents.rdf
  preview.png
  icon.png
  browser/files
  global/files
  mozapps/files
  communicator/files
  ...
     
  • You must have a top-level chrome.manifest (Firefox/Thunderbird 1.5) or contents.rdf file which registers the chrome for the theme (as before) and also an install.rdf manifest that specifies metadata that is displayed in the Themes window.
  • preview.png is a preview image which will show in the scrolling preview area in the Themes window. It can be any size.
  • icon.png is a 32x32 PNG (may contain alpha transparency) which will show up in the Themes list in the Themes window.

install.rdf

Your install.rdf manifest will look something like this:

<?xml version="1.0"?>

<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">

  <Description about="urn:mozilla:install-manifest">
    <em:type>4</em:type>
    more properties
  </Description>      
</RDF>

Required install.rdf Properties

Your install.rdf file must have the following properties. See the install.rdf Reference for more information:

  • em:id
  • em:version
  • em:type
  • em:targetApplication
  • em:name
  • em:internalName

Optional install.rdf Properties

  • em:description
  • em:creator
  • em:contributor
  • em:homepageURL
  • em:updateURL

Note that if your theme will be made available on the http://addons.mozilla.org website, it should not include an updateURL.

Sample install.rdf File

<?xml version="1.0"?>

<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">

  <Description about="urn:mozilla:install-manifest">
    <em:id>{18b64b56-d42f-428d-a88c-baa413bc413f}</em:id>
    <em:version>1.0</em:version>
    <em:type>4</em:type>

    <!-- Target Application this extension can install into, 
         with minimum and maximum supported versions. -->
    <em:targetApplication>
      <Description>
        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
        <em:minVersion>0.8</em:minVersion>
        <em:maxVersion>0.9</em:maxVersion>
      </Description>
    </em:targetApplication>
    
    <!-- Front End MetaData -->
    <em:name>New Theme 1</em:name>
    <em:description>A test theme for Firefox</em:description>
    <em:creator>Ben Goodger</em:creator>
    <em:contributor>John Doe</em:contributor>
    <em:homepageURL>http://www.bengoodger.com/</em:homepageURL>

    <!-- Front End Integration Hooks (used by Theme Manager)-->
    <em:internalName>newtheme1</em:internalName>
  </Description>
</RDF>

The following are some common target application GUIDs that you can use in your targetApplication properties:

Firefox      {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Thunderbird  {3550f703-e582-4d05-9a08-453d09bdfdc6}
Sunbird      {718e30fb-e89b-41dd-9da7-e25a45638b28}

Official References for Toolkit API

{{wiki.template(':pt/Toolkit_API/Official_References')}}

{{ wiki.languages( { "en": "en/Theme_Packaging", "fr": "fr/Empaqueter_un_th\u00e8me", "ja": "ja/Theme_Packaging" } ) }}

Fonte da revisão

<p>
</p><p>Este documento descreve como empacotar <a href="pt/Temas">temas</a> para o Firefox e o Thunderbird.
</p>
<h3 name="Pr.C3.A9_Requisitos"> Pré Requisitos </h3>
<p>Fazer um tema para o Firefox ou Thunderbird requer conhecimentos em Cascading Style Sheets (<a href="pt/CSS">CSS</a>), provavelmente <a href="pt/XBL">XBL</a>, e um pouco de design gráfico e habilidade estética (...ou talvez não). Este documento descreve somente como Temas são empacotados em ordem para serem mostrados na janela de Temas do Firefox.
</p>
<h3 name="Disposi.C3.A7.C3.A3o_do_Arquivo_de_Tema"> Disposição do Arquivo de Tema </h3>
<p>Os temas do Firefox/Thunderbird são empacotados em um arquivo JAR com a seguinte estrutura:
</p>
<pre class="eval">theme.jar:
  install.rdf
  contents.rdf
  preview.png
  icon.png
  browser/<i>files</i>
  global/<i>files</i>
  mozapps/<i>files</i>
  communicator/<i>files</i>
  ...
     
</pre>
<ul><li> You must have a top-level <a href="pt/Chrome.manifest">chrome.manifest</a> (Firefox/Thunderbird 1.5) or contents.rdf file which registers the chrome for the theme (as before) and also an <a href="pt/Install.rdf">install.rdf</a> manifest that specifies metadata that is displayed in the Themes window.
</li><li> preview.png is a preview image which will show in the scrolling preview area in the Themes window. It can be any size.
</li><li> icon.png is a 32x32 PNG (may contain alpha transparency) which will show up in the Themes list in the Themes window.
</li></ul>
<h3 name="install.rdf"> install.rdf </h3>
<p>Your <a href="pt/Install.rdf">install.rdf</a> manifest will look something like this:
</p>
<pre class="eval">&lt;?xml version="1.0"?&gt;

&lt;RDF xmlns="<span class="plain">http://www.w3.org/1999/02/22-rdf-syntax-ns#</span>"
     xmlns:em="<span class="plain">http://www.mozilla.org/2004/em-rdf#</span>"&gt;

  &lt;Description about="urn:mozilla:install-manifest"&gt;
    &lt;em:type&gt;4&lt;/em:type&gt;
    <i>more properties</i>
  &lt;/Description&gt;      
&lt;/RDF&gt;
</pre>
<h4 name="Required_install.rdf_Properties"> Required install.rdf Properties </h4>
<p>Your install.rdf file must have the following properties. See the <a href="pt/Install.rdf">install.rdf Reference</a> for more information:
</p>
<ul><li> em:id
</li><li> em:version
</li><li> em:type
</li><li> em:targetApplication
</li><li> em:name
</li><li> em:internalName
</li></ul>
<h4 name="Optional_install.rdf_Properties"> Optional install.rdf Properties </h4>
<ul><li> em:description
</li><li> em:creator
</li><li> em:contributor
</li><li> em:homepageURL
</li><li> em:updateURL
</li></ul>
<p>Note that if your theme will be made available on the http://addons.mozilla.org website, it should not include an updateURL.
</p>
<h4 name="Sample_install.rdf_File"> Sample install.rdf File </h4>
<pre class="eval">&lt;?xml version="1.0"?&gt;

&lt;RDF xmlns="<span class="plain">http://www.w3.org/1999/02/22-rdf-syntax-ns#</span>"
     xmlns:em="<span class="plain">http://www.mozilla.org/2004/em-rdf#</span>"&gt;

  &lt;Description about="urn:mozilla:install-manifest"&gt;
    &lt;em:id&gt;{18b64b56-d42f-428d-a88c-baa413bc413f}&lt;/em:id&gt;
    &lt;em:version&gt;1.0&lt;/em:version&gt;
    &lt;em:type&gt;4&lt;/em:type&gt;

    &lt;!-- Target Application this extension can install into, 
         with minimum and maximum supported versions. --&gt;
    &lt;em:targetApplication&gt;
      &lt;Description&gt;
        &lt;em:id&gt;{ec8030f7-c20a-464f-9b0e-13a3a9e97384}&lt;/em:id&gt;
        &lt;em:minVersion&gt;0.8&lt;/em:minVersion&gt;
        &lt;em:maxVersion&gt;0.9&lt;/em:maxVersion&gt;
      &lt;/Description&gt;
    &lt;/em:targetApplication&gt;
    
    &lt;!-- Front End MetaData --&gt;
    &lt;em:name&gt;New Theme 1&lt;/em:name&gt;
    &lt;em:description&gt;A test theme for Firefox&lt;/em:description&gt;
    &lt;em:creator&gt;Ben Goodger&lt;/em:creator&gt;
    &lt;em:contributor&gt;John Doe&lt;/em:contributor&gt;
    &lt;em:homepageURL&gt;<span class="plain">http://www.bengoodger.com/</span>&lt;/em:homepageURL&gt;

    &lt;!-- Front End Integration Hooks (used by Theme Manager)--&gt;
    &lt;em:internalName&gt;newtheme1&lt;/em:internalName&gt;
  &lt;/Description&gt;
&lt;/RDF&gt;
</pre>
<p>The following are some common target application GUIDs that you can use in your targetApplication properties:
</p>
<pre class="eval">Firefox      {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Thunderbird  {3550f703-e582-4d05-9a08-453d09bdfdc6}
Sunbird      {718e30fb-e89b-41dd-9da7-e25a45638b28}
</pre>
<h3 name="Official_References_for_Toolkit_API"> Official References for <a href="pt/Toolkit_API">Toolkit API</a> </h3>
<p>{{wiki.template(':pt/Toolkit_API/Official_References')}}
</p>{{ wiki.languages( { "en": "en/Theme_Packaging", "fr": "fr/Empaqueter_un_th\u00e8me", "ja": "ja/Theme_Packaging" } ) }}
Reverter para esta revisão