aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/mozilla/tech/xpcom
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 21:46:22 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 21:46:22 -0500
commita065e04d529da1d847b5062a12c46d916408bf32 (patch)
treefe0f8bcec1ff39a3c499a2708222dcf15224ff70 /files/pt-br/mozilla/tech/xpcom
parent218934fa2ed1c702a6d3923d2aa2cc6b43c48684 (diff)
downloadtranslated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.gz
translated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.bz2
translated-content-a065e04d529da1d847b5062a12c46d916408bf32.zip
update based on https://github.com/mdn/yari/issues/2028
Diffstat (limited to 'files/pt-br/mozilla/tech/xpcom')
-rw-r--r--files/pt-br/mozilla/tech/xpcom/como_construir_um_componente_xpcom_em_javascript/index.html221
-rw-r--r--files/pt-br/mozilla/tech/xpcom/guide/index.html21
-rw-r--r--files/pt-br/mozilla/tech/xpcom/index.html47
-rw-r--r--files/pt-br/mozilla/tech/xpcom/reference/index.html18
-rw-r--r--files/pt-br/mozilla/tech/xpcom/reference/interface/index.html17
-rw-r--r--files/pt-br/mozilla/tech/xpcom/reference/interface/nsidevicemotion/index.html129
6 files changed, 0 insertions, 453 deletions
diff --git a/files/pt-br/mozilla/tech/xpcom/como_construir_um_componente_xpcom_em_javascript/index.html b/files/pt-br/mozilla/tech/xpcom/como_construir_um_componente_xpcom_em_javascript/index.html
deleted file mode 100644
index f1c6757292..0000000000
--- a/files/pt-br/mozilla/tech/xpcom/como_construir_um_componente_xpcom_em_javascript/index.html
+++ /dev/null
@@ -1,221 +0,0 @@
----
-title: Como construir um componente XPCOM em Javascript
-slug: Mozilla/Tech/XPCOM/Como_construir_um_componente_XPCOM_em_Javascript
-translation_of: Mozilla/Tech/XPCOM/Guide/Building_components_in_JavaScript
----
-<p><span id="result_box" lang="pt"><span class="hps">Este é um tutorial</span> <span class="hps">"Olá Mundo"</span> <span class="hps">para a criação de</span> <span class="hps">um componente</span> <span class="hps">XPCOM</span> <span class="hps">em</span> <span class="hps">JavaScript</span><span>.</span> <span class="hps">Este</span> <span class="hps">tutorial</span> <span class="hps">não descreve</span> <span class="hps">como e por que</span> <span class="hps">XPCOM</span> <span class="hps">funciona da maneira que</span> <span class="hps">faz, ou</span> <span class="hps">o que cada</span> <span class="hps">bit</span> <span class="hps">do código de exemplo</span> <span class="hps">faz.</span> <span class="hps">Isso</span> <span class="hps">foi detalhado</span> <span class="hps">em outro lugar.</span> <span class="hps">Este</span> <span class="hps">tutorial</span> <span class="hps">irá mostrar-lhe</span> <span class="hps">o que você precisa</span> <span class="hps">fazer para obter um</span> <span class="hps">componente</span> <span class="hps">de trabalho</span> <span class="hps">como</span> <span class="hps">poucos e</span> <span class="hps">como passos</span> <span class="hps">mais simples possível.</span></span></p>
-<h2 id="Implementation" name="Implementation"><span class="short_text" id="result_box" lang="pt"><span class="hps">Implementação</span></span></h2>
-<p><span id="result_box" lang="pt"><span class="hps">Este componente</span> <span class="hps">exemplo,</span> <span class="hps">irá expor</span> <span class="hps">um único método</span><span>, que retorna a</span> <span class="hps atn">string "</span><span>Olá</span> <span class="hps">Mundo!"</span><span>.</span></span></p>
-<h3 id="Defining_the_Interface" name="Defining_the_Interface"><span class="short_text" id="result_box" lang="pt"><span class="hps">Definindo</span> <span class="hps">a Interface</span></span></h3>
-<p><span id="result_box" lang="pt"><span class="hps">Se você</span> <span class="hps">quiser usar o</span> <span class="hps">componente</span> <span class="hps">em outras</span> <span class="hps">componentes XPCOM</span><span>, você deve definir</span> <span class="hps">as interfaces que</span> <span class="hps">você</span> <span class="hps">deseja expor</span><span>.</span> <span class="hps">Se você</span> <span class="hps">quiser usar o seu</span> <span class="hps">único componente</span> <span class="hps">de</span> <span class="hps">JavaScript,</span> <span class="hps">você pode</span> <span class="hps">pular para</span> <span class="hps">a</span></span> <a href="#Using_XPCOMUtils"><span class="short_text" id="result_box" lang="pt"><span class="hps">próxima seção</span></span></a>.</p>
-<p><span id="result_box" lang="pt"><span class="hps">Há</span> <span class="hps">muitas interfaces</span> <span class="hps">já</span> <span class="hps">definidas nos aplicativos</span> <span class="hps">Mozilla</span><span>, então</span> <span class="hps">você pode não precisar</span> <span class="hps">de definir</span> <span class="hps">um novo.</span> <span class="hps">Você pode procurar</span> <span class="hps">as interfaces</span> <span class="hps">XPCOM</span> <span class="hps">existentes</span> <span class="hps">em vários locais</span> <span class="hps">no código fonte</span> <span class="hps">Mozilla,</span> <span class="hps">ou</span> <span class="hps">usando </span></span><a class="external" href="http://www.ondrejd.info/projects/xpcomviewer/" title="http://www.ondrejd.info/projects/xpcomviewer/">XPCOMViewer</a>, <span id="result_box" lang="pt"><span class="hps">uma interface gráfica</span> <span class="hps">para navegar</span> <span class="hps">interfaces e</span> <span class="hps">componentes</span> <span class="hps">registrados.</span> <span class="hps">Você pode baixar</span> <span class="hps">uma versão antiga do</span> <span class="hps">XPCOMViewer</span> <span class="hps">que funciona</span> <span class="hps">com</span> <span class="hps">Firefox 1.5</span> <span class="hps">a partir de</span></span> <a class="external" href="http://downloads.mozdev.org/xpcomviewer/">mozdev mirrors</a>.</p>
-<p><span id="result_box" lang="pt"><span class="hps">Se</span> <span class="hps">existe</span> <span class="hps">uma interface</span> <span class="hps">que atenda às suas</span> <span class="hps">necessidades, então</span> <span class="hps">você não</span> <span class="hps">precisa escrever</span> <span class="hps">uma</span> <span class="hps">IDL</span><span>,</span> <span class="hps">ou</span> <span class="hps">compilar uma</span> <span class="hps">biblioteca de tipos</span><span>,</span> <span class="hps">e pode</span> <span class="hps">pular para</span> <span class="hps">a</span></span> <a href="#Using_XPCOMUtils"><span class="short_text" id="result_box" lang="pt"><span class="hps">próxima seção</span></span></a>.</p>
-<p><span id="result_box" lang="pt"><span class="hps">Se você não</span> <span class="hps">encontrar</span> <span class="hps">uma relação</span> <span class="hps">pré-existente</span> <span class="hps">adequada,</span> <span class="hps">em seguida,</span> <span class="hps">você deve definir</span> <span class="hps">o seu próprio.</span> <span class="hps">XPCOM</span> <span class="hps">usa</span> <span class="hps">um dialeto do</span> <span class="hps">IDL</span> <span class="hps">para</span> <span class="hps">definir interfaces</span><span>, chamada</span></span> <a href="/en/XPIDL" title="en/XPIDL">XPIDL</a>. <span id="result_box" lang="pt"><span class="hps">Aqui está a</span> <span class="hps">definição</span> <span class="hps">XPIDL</span> <span class="hps">para o nosso</span> <span class="hps">componente</span> <span class="hps">Olá Mundo</span></span>:</p>
-<p>HelloWorld.idl</p>
-<pre>#include "nsISupports.idl"
-
-[scriptable, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)]
-interface nsIHelloWorld : nsISupports
-{
- string hello();
-};
-</pre>
-<p><span id="result_box" lang="pt"><span class="hps">Observe que você deve</span> <span class="hps">gerar</span> <span class="hps">um novo</span> <span class="hps">UUID</span> <span class="hps">para cada componente</span> <span class="hps">XPCOM</span> <span class="hps">que você criar.</span> <span class="hps">ver</span></span> <a href="/en/Generating_GUIDs" title="en/Generating_GUIDs">Generating GUIDs</a> <span class="short_text" id="result_box" lang="pt"><span class="hps">para mais informações</span></span>.</p>
-<h3 id="Compiling_the_Typelib" name="Compiling_the_Typelib"><span class="short_text" id="result_box" lang="pt"><span class="hps">Compilando o</span> <span class="hps">Typelib</span></span></h3>
-<p><span id="result_box" lang="pt"><span class="hps">Sua</span> <span class="hps">definição de interface</span> <span class="hps">deve ser compilado</span> <span class="hps">em um formato binário</span> <span class="hps atn">(</span><span>XPT)</span><span>, a fim de</span> <span class="hps">ser registrado e</span> <span class="hps">usado</span> <span class="hps">em aplicativos</span> <span class="hps">Mozilla</span><span>.</span> <span class="hps">A compilação</span> <span class="hps">pode ser feito</span> <span class="hps">usando o</span> <span class="hps">Gecko</span> <span class="hps">SDK.</span> <span class="hps">Você pode aprender</span> <span class="hps">como obter</span> <span class="hps">Mac</span><span>, Linux e</span> <span class="hps">versões</span> <span class="hps">do Windows do</span> <span class="hps">Gecko</span> <span class="hps">SDK</span> <span class="hps">lendo o artigo</span></span> <a href="/en/Gecko_SDK" title="en/Gecko_SDK">Gecko SDK</a>.</p>
-<h4 id="Para_o_código_de_fora_da_árvore"><span class="short_text" id="result_box" lang="pt"><span class="hps">Para o código de</span> <span class="hps">fora da árvore</span></span></h4>
-<div class="note">
- <span id="result_box" lang="pt"><span class="hps"><strong>Nota</strong>: No Windows</span><span>, se você</span> <span class="hps">baixar o</span> <span class="hps">Gecko</span> <span class="hps">SDK</span><span>, sem</span> <span class="hps">toda</span> <span class="hps">a árvore de criação</span><span>, você vai</span> <span class="hps">estar faltando</span> <span class="hps">algumas</span> <span class="hps">DLLs</span> <span class="hps">necessárias para</span> <span class="hps">xpidl.exe</span> <span class="hps">e ele será executado</span> <span class="hps">sem erros</span><span>, mas não</span> <span class="hps">fazer nada.</span> <span class="hps">Para corrigir</span> <span class="hps">esta transferência</span> <span class="hps">o </span></span><a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip">Mozilla build <span class="short_text" id="result_box" lang="pt"><span class="hps">ferramentas para</span></span> Windows</a> <span id="result_box" lang="pt"><span class="hps">e copiar as</span> <span class="hps">DLLs</span> <span class="hps">do</span> <span class="hps">windows \</span> <span class="hps">bin \</span> <span class="hps">x86</span> <span class="hps">dentro do</span> <span class="hps">zip</span> <span class="hps">para o diretório</span> <span class="hps">bin</span> <span class="hps">do</span> <span class="hps">Gecko</span> <span class="hps">SDK.</span></span></div>
-<div class="note">
- <span id="result_box" lang="pt"><span class="hps"><strong>Nota</strong>: A versão</span> <span class="hps">Mac</span> <span class="hps">do</span> <span class="hps">SDK</span> <span class="hps">fornecido</span> <span class="hps">para download</span> <span class="hps">é</span> <span class="hps">apenas para</span> <span class="hps">PowerPC</span><span>.</span> <span class="hps">Se você precisa de</span> <span class="hps">uma versão</span> <span class="hps">Intel</span><span>,</span> <span class="hps">você precisa</span> <span class="hps">compilá-lo</span> <span class="hps">como descrito</span> <span class="hps">na página.</span></span></div>
-<p><span id="result_box" lang="pt"><span class="hps">Executar este comando</span> <span class="hps">para compilar o</span> <span class="hps">typelib</span><span>.</span> <span class="hps">Aqui,</span></span> <code>{sdk_dir}</code> <span id="result_box" lang="pt"><span class="hps">é o</span> <span class="hps">diretório no qual você</span> <span class="hps">descompactou o</span> <span class="hps">Gecko</span> <span class="hps">SDK.</span></span></p>
-<pre class="eval">{sdk_dir}/bin/xpidl -m typelib -w -v -I {sdk_dir}/idl -e HelloWorld.xpt HelloWorld.idl
-</pre>
-<div class="note">
- <span id="result_box" lang="pt"><span class="hps"><strong>Nota</strong>: No</span> <span class="hps">Windows, você deve</span> <span class="hps">usar barras</span> <span class="hps">para o caminho</span> <span class="hps">de inclusão.</span></span></div>
-<div class="note">
- <strong>Nota:</strong> (o -I flag é um uppercase i, <span class="short_text" id="result_box" lang="pt"><span class="hps">não é um</span></span> lowercase L.)</div>
-<p><span id="result_box" lang="pt"><span class="hps">Isto irá criar</span> <span class="hps">o</span> <span class="hps">arquivo</span> <span class="hps">HelloWorld.xpt</span> <span class="hps">typelib</span> <span class="hps">no diretório de trabalho</span> <span class="hps">atual.</span></span></p>
-<h4 id="Para_um_novo_componente_em_FirefoxThunderbirdB2G"><span class="short_text" id="result_box" lang="pt"><span class="hps">Para um novo</span> <span class="hps">componente</span> <span class="hps">em</span> <span class="hps">Firefox/Thunderbird/B2G</span></span></h4>
-<p><span id="result_box" lang="pt"><span class="hps">Se você estiver adicionando</span> <span class="hps">uma nova funcionalidade</span> <span class="hps">para</span> <span class="hps">aplicações no</span> <span class="hps">repositório</span> <span class="hps atn">mozilla-</span><span>central,</span> <span class="hps">você pode criar um</span> <span class="hps">Makefile</span> <span class="hps">listando os arquivos</span> <span class="hps">IDL</span> <span class="hps">e</span> <span class="hps">o sistema de compilação</span> <span class="hps">irá gerar</span> <span class="hps">automaticamente o</span> <span class="hps">typelib</span><span>.</span> <span class="hps">A</span> <span class="hps">amostra</span> <span class="hps">Makefile.in</span></span></p>
-<pre># This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-DEPTH = @DEPTH@
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-
-<span id="the-code"># MODULE specifies where header files from this Makefile are installed</span>
-# Use dom if your component implements a DOM API
-MODULE = dom
-
-# Name of the typelib
-XPIDL_MODULE = dom_apps
-
-# Set to 1 if the module should be part of the Gecko Runtime common to all applications
-GRE_MODULE = 1
-
-# The IDL sources
-XPIDLSRCS = \
- HelloWorld.idl \
- $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-XPIDL_FLAGS += \
- -I$(topsrcdir)/dom/interfaces/base \
- -I$(topsrcdir)/dom/interfaces/events \
- $(NULL)</pre>
-<h3 id="Using_XPCOMUtils" name="Using_XPCOMUtils"><span class="short_text" id="result_box" lang="pt"><span class="hps">Criando o</span> <span class="hps">componente usando</span> <span class="hps">XPCOMUtils</span></span></h3>
-<p>{{ Fx_minversion_inline(3) }} em <a href="/en/Firefox_3_for_developers" title="en/Firefox_3_for_developers">Firefox 3</a> <span class="short_text" id="result_box" lang="pt"><span class="hps">e mais tarde</span> <span class="hps">você pode usar</span> <span class="hps">importação </span></span><a href="/en/JavaScript_code_modules/XPCOMUtils.jsm" title="en/XPCOMUtils.jsm">XPCOMUtils.jsm</a> <span class="short_text" id="result_box" lang="pt"><span class="hps">utilização</span></span> <a href="/en/Components.utils.import" title="en/Components.utils.import">Components.utils.import</a> <span id="result_box" lang="pt"><span class="hps">para simplificar o processo</span> <span class="hps">de escrever o seu</span> <span class="hps">componente</span> <span class="hps">ligeiramente.</span> <span class="hps">A biblioteca</span> <span class="hps">importada</span> <span class="hps">contém funções para</span> <span class="hps">gerar o</span> <span class="hps">módulo</span><span>, a fábrica,</span> <span class="hps">e</span> <span class="hps">os</span> <span class="hps">NSGetModule</span> <span class="hps">e</span> <span class="hps">QueryInterface</span> <span class="hps">funções para você</span><span>.</span> <span class="hps"><strong>Nota</strong>:</span> <span class="hps">ele não faz</span> <span class="hps">o trabalho de criar</span> <span class="hps">o arquivo de</span> <span class="hps">definição de interface</span> <span class="hps">ou</span> <span class="hps">a biblioteca de tipos</span> <span class="hps">para você, então</span> <span class="hps">você ainda tem que</span> <span class="hps">passar por essas</span> <span class="hps">etapas anteriores</span><span>, caso não tenham</span> <span class="hps">sido feito.</span> <span class="hps">A biblioteca</span> <span class="hps">proporciona</span> <span class="hps">um exemplo simples de</span> <span class="hps">sua utilização</span> <span class="hps">no código fonte</span></span> ({{ Source("js/src/xpconnect/loader/XPCOMUtils.jsm") }}), <span id="result_box" lang="pt"><span class="hps">mas aqui é</span> <span class="hps">outro usando</span> <span class="hps">este exemplo.</span> <span class="hps">Para começar</span><span>, inclua uma linha</span> <span class="hps">no topo da</span> <span class="hps">sua interface</span> <span class="hps">para importar a biblioteca</span> <span class="hps">XPCOMUtils</span><span>:</span></span></p>
-<pre class="brush: js">Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-</pre>
-<p><span id="result_box" lang="pt"><span class="hps">em seguida, implementar</span> <span class="hps">a interface</span> <span class="hps">da mesma forma que</span> <span class="hps">fiz</span> <span class="hps">acima, exceto</span> <span class="hps">com algumas modificações</span> <span class="hps">para que</span> <span class="hps">XPCOMUtils</span> <span class="hps">pode configurá-lo</span> <span class="hps">corretamente:</span></span></p>
-<pre class="brush: js">/***********************************************************
-class definition
-***********************************************************/
-
-//class constructor
-function HelloWorld() {
-// If you only need to access your component from Javascript, uncomment the following line:
-//this.wrappedJSObject = this;
-}
-
-// class definition
-HelloWorld.prototype = {
-
- // properties required for XPCOM registration:
- classDescription: "My Hello World Javascript XPCOM Component",
- classID: Components.ID("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"),
- contractID: "@dietrich.ganx4.com/helloworld;1",
-
- // [optional] custom factory (an object implementing nsIFactory). If not
- // provided, the default factory is used, which returns
- // |(new MyComponent()).QueryInterface(iid)| in its createInstance().
- _xpcom_factory: { ... },
-
- // [optional] an array of categories to register this component in.
- _xpcom_categories: [{
-
- // Each object in the array specifies the parameters to pass to
- // nsICategoryManager.addCategoryEntry(). 'true' is passed for both
- // aPersist and aReplace params.
- category: "some-category",
-
- // optional, defaults to the object's classDescription
- entry: "entry name",
-
- // optional, defaults to the object's contractID (unless 'service' is specified)
- value: "...",
-
- // optional, defaults to false. When set to true, and only if 'value' is not
- // specified, the concatenation of the string "service," and the object's contractID
- // is passed as aValue parameter of addCategoryEntry.
- service: true
- }],
-
- // QueryInterface implementation, e.g. using the generateQI helper (remove argument if skipped steps above)
- QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIHelloWorld]),
-
- // Optional, but required if you want your component to be exposed to DOM
- classInfo: XPCOMUtils.generateCI({classID: Components.ID("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"),
-                                    contractID: "@dietrich.ganx4.com/helloworld;1",
-                                    interfaces: [Ci.nsIHelloWorld],
-                                    flags: Ci.nsIClassInfo.DOM_OBJECT}),
-
- // ...component implementation...
- // define the function we want to expose in our interface
- hello: function() {
- return "Hello World!";
- },
-};
-</pre>
-<p><span id="result_box" lang="pt"><span class="hps">XPCOMUtils</span> <span class="hps">faz o trabalho de</span> <span class="hps">criação do</span> <span class="hps">módulo</span> <span class="hps">e da fábrica</span> <span class="hps">para você</span> <span class="hps">depois disso.</span> <span class="hps">Finalmente, você cria</span> <span class="hps">uma matriz</span> <span class="hps">de</span> <span class="hps">seus</span> <span class="hps">componentes a serem criados</span><span>:</span></span></p>
-<pre class="brush: js"> var components = [HelloWorld];
-</pre>
-<p><span id="result_box" lang="pt"><span class="hps">e substituir</span> <span class="hps">NSGetFactory</span> <span class="hps">/</span> <span class="hps">NSGetModule</span> <span class="hps">usar</span> <span class="hps">essa matriz</span> <span class="hps">e</span> <span class="hps">XPCOMUtils</span><span>:</span></span></p>
-<pre class="brush: js"> if ("generateNSGetFactory" in XPCOMUtils)
- var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); // Firefox 4.0 and higher
- else
- var NSGetModule = XPCOMUtils.generateNSGetModule(components); // Firefox 3.x
-</pre>
-<p><span id="result_box" lang="pt"><span class="hps">Assim, a versão</span> <span class="hps">simplificada do</span> <span class="hps">total de</span> <span class="hps">seu componente</span> <span class="hps">agora</span> <span class="hps">parece</span> <span class="hps">(é claro que</span> <span class="hps">a documentação</span> <span class="hps">e os comentários</span> <span class="hps">não são uma coisa</span> <span class="hps">ruim, mas</span> <span class="hps">como um modelo</span> <span class="hps">algo menor</span> <span class="hps">é bom ter</span><span>)</span><span>:</span></span></p>
-<pre class="brush: js">Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-function HelloWorld() { }
-
-HelloWorld.prototype = {
- classDescription: "My Hello World Javascript XPCOM Component",
- classID: Components.ID("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"),
- contractID: "@dietrich.ganx4.com/helloworld;1",
- QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIHelloWorld]),
- hello: function() { return "Hello World!"; }
-};
-var components = [HelloWorld];
-if ("generateNSGetFactory" in XPCOMUtils)
- var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); // Firefox 4.0 and higher
-else
- var NSGetModule = XPCOMUtils.generateNSGetModule(components); // Firefox 3.x
-</pre>
-<div class="note">
- <span id="result_box" lang="pt"><span class="hps"><strong>Nota</strong>:</span> <span class="hps">A partir do</span> <span class="hps">Firefox 4.0</span> <span class="hps">será necessário</span> <span class="hps">declarar</span> <span class="hps">o componente</span> <span class="hps">em</span> <span class="hps">chrome.manifest</span><span>;</span> <span class="hps">classDescription</span> <span class="hps">e</span> <span class="hps">propriedades</span> <span class="hps">contractID</span> <span class="hps">por outro lado,</span> <span class="hps">não são mais necessários</span><span>.</span> <span class="hps">ver </span></span><a href="/en/XPCOM/XPCOM_changes_in_Gecko_2.0" title="XPCOM changes in Gecko 2.0">XPCOM changes in Gecko 2.0</a> <span class="short_text" id="result_box" lang="pt"><span class="hps">para mais detalhes</span></span>.</div>
-<h2 id="Installation" name="Installation"><span class="short_text" id="result_box" lang="pt"><span class="hps">Instalação</span></span></h2>
-<h3 id="For_extensions:" name="For_extensions:"><span class="short_text" id="result_box" lang="pt"><span class="hps">para extensões</span></span>:</h3>
-<ol>
- <li><span id="result_box" lang="pt"><span class="hps">Helloworld.js</span> <span class="hps">copiar e</span> <span class="hps">HelloWorld.xpt</span> <span class="hps atn">(</span><span>só</span> <span class="hps">se você tiver definido</span> <span class="hps">e</span> <span class="hps">compilou o</span> <span class="hps">IDL</span><span>) para</span></span> <code>{extensiondir}/components/</code>.</li>
- <li><span id="result_box" lang="pt"><span class="hps">Excluir</span> <span class="hps">compreg.dat</span> <span class="hps">e</span> <span class="hps">xpti.dat</span> <span class="hps">do seu</span> <span class="hps">diretório de perfil</span></span>.</li>
- <li><span class="short_text" id="result_box" lang="pt"><span class="hps">reinicie o</span> <span class="hps">aplicativo</span></span>.</li>
-</ol>
-<h3 id="For_Firefox" name="For_Firefox">Para Firefox:</h3>
-<ol>
- <li><span id="result_box" lang="pt"><span class="hps">Helloworld.js</span> <span class="hps">copiar e</span> <span class="hps">HelloWorld.xpt</span> <span class="hps atn">(</span><span>só</span> <span class="hps">se você tiver definido</span> <span class="hps">e</span> <span class="hps">compilou o</span> <span class="hps">IDL</span><span>) para</span> <span class="hps">o</span></span> <code>{objdir}/dist/bin/components</code> directory, <span class="short_text" id="result_box" lang="pt"><span class="hps">se</span> <span class="hps">correr a partir da</span> <span class="hps">fonte</span><span>.</span></span></li>
- <li><span id="result_box" lang="pt"><span class="hps">Excluir</span> <span class="hps">compreg.dat</span> <span class="hps">e</span> <span class="hps">xpti.dat</span> <span class="hps">do diretório</span> <span class="hps">componentes</span></span>.</li>
- <li><span id="result_box" lang="pt"><span class="hps">Excluir</span> <span class="hps">compreg.dat</span> <span class="hps">e</span> <span class="hps">xpti.dat</span> <span class="hps">do seu</span> <span class="hps">diretório de perfil</span></span>.</li>
- <li><span class="short_text" id="result_box" lang="pt"><span class="hps">reinicie o</span> <span class="hps">aplicativo</span></span>.</li>
-</ol>
-<h2 id="Using_Your_Component" name="Using_Your_Component"><span class="short_text" id="result_box" lang="pt"><span class="hps">Usando o</span> <span class="hps">Componente</span></span></h2>
-<h3 id="Using_wrappedJSObject" name="Using_wrappedJSObject"><span class="short_text" id="result_box" lang="pt"><span class="hps">Usando</span> <span class="hps">wrappedJSObject</span></span></h3>
-<p><span id="result_box" lang="pt"><span class="hps">Se</span> <span class="hps">você só pretende</span> <span class="hps">aceder à sua</span> <span class="hps">componente</span> <span class="hps">de</span> <span class="hps">Javascript</span><span>, ou seja,</span> <span class="hps">você pulou</span> <span class="hps">as seções</span> <span class="hps">"Definindo</span> <span class="hps">a</span> <span class="hps">Interface"</span> <span class="hps atn">e "</span><span>Compilando o</span> <span class="hps">Typelib</span><span>" acima</span><span>, é</span> <span class="hps">comentada</span> <span class="hps atn">a linha "</span><span>wrappedJSObject</span><span>"</span> <span class="hps">no construtor da classe</span><span>, e</span> <span class="hps">removido</span> <span class="hps">o</span></span> "[Components.interfaces.nsIHelloWorld]" <span class="short_text" id="result_box" lang="pt"><span class="hps">argumento para</span> <span class="hps">a chamada para </span></span>XPCOMUtils.generateQI() em QueryInterface, <span id="result_box" lang="pt"><span class="hps">então você pode acessar</span> <span class="hps">o seu componente</span> <span class="hps">da seguinte forma:</span></span></p>
-<pre class="brush: js">try {
- var myComponent = Components.classes['@dietrich.ganx4.com/helloworld;1']
- .getService().wrappedJSObject;
-
- alert(myComponent.hello());
-} catch (anError) {
- dump("ERROR: " + anError);
-}
-</pre>
-<p><span id="result_box" lang="pt"><span class="hps">Para mais informações sobre</span> <span class="hps">wrappedJSObject</span><span>, veja</span></span> <a href="/en/wrappedJSObject" title="en/wrappedJSObject">aqui</a>.</p>
-<h3 id="Using_XPCOM_instantiation" name="Using_XPCOM_instantiation"><span class="short_text" id="result_box" lang="pt"><span class="hps">Usando</span> <span class="hps">instanciação</span> <span class="hps">XPCOM</span></span></h3>
-<pre class="brush: js">try {
- var myComponent = Components.classes['@dietrich.ganx4.com/helloworld;1']
- .createInstance(Components.interfaces.nsIHelloWorld);
-
- alert(myComponent.hello());
-} catch (anError) {
- dump("ERROR: " + anError);
-}
-</pre>
-<h2 id="Other_resources" name="Other_resources"><span class="short_text" id="result_box" lang="pt"><span class="hps">Outros</span> <span class="hps">recursos</span></span></h2>
-<ul>
- <li><span id="result_box" lang="pt"><span class="hps">Dois</span> <span class="hps">fóruns</span> <span class="hps">tópicos</span> <span class="hps">mozillazine</span> <span class="hps">sobre a implementação de</span> <span class="hps">componentes XPCOM</span> <span class="hps">em</span> <span class="hps">JS</span> <span class="hps">com algumas</span> <span class="hps">explicações,</span> <span class="hps">exemplo</span> <span class="hps">de código</span> <span class="hps">e dicas</span> <span class="hps">para solução de problemas</span><span>:</span></span>
- <ul>
- <li><a class="external" href="http://forums.mozillazine.org/viewtopic.php?t=308369" rel="freelink">http://forums.mozillazine.org/viewtopic.php?t=308369</a></li>
- <li><a class="external" href="http://forums.mozillazine.org/viewtopic.php?t=367298" rel="freelink">http://forums.mozillazine.org/viewtopic.php?t=367298</a></li>
- </ul>
- </li>
- <li><a class="external" href="http://kb.mozillazine.org/Implementing_XPCOM_components_in_JavaScript">Implementing XPCOM components in JavaScript</a> at kb.mozillazine.org</li>
- <li><a class="external" href="http://www.mozilla.org/scriptable/avoiding-leaks.html">Using XPCOM in JavaScript without leaking</a> - A must-read.</li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpcom/sample/nsSample.js">An example component</a></li>
- <li><a class="external" href="http://www.mozilla.org/scriptable/js-components-status.html">Older JS+XPCOM notes</a> - <span class="short_text" id="result_box" lang="pt"><span class="hps">inclui algumas informações</span> <span class="hps">wrappedJSObject</span></span>.</li>
- <li><a class="external" href="http://weblogs.mozillazine.org/weirdal/archives/019620.html" title="http://weblogs.mozillazine.org/weirdal/archives/019620.html">Writing an XPCOM <em><u>Service</u></em> in javascript</a></li>
-</ul>
-<p>{{ languages( { "fr": "fr/compiler_un_composant_xpcom_javascript", "zh-cn": "cn/How_to_Build_an_XPCOM_Component_in_Javascript", "ja": "ja/How_to_Build_an_XPCOM_Component_in_Javascript" } ) }}</p>
-<p> </p>
-<p><strong>Tradução para o portugues(Brasil) : Josimar de souza</strong></p>
-<p>contato : portaldobarulho@hotmail.com</p>
-<p>site : <a href="http://facebook.com/soundbrasil" title="http://facebook.com/soundbrasil">Portal do Barulho</a></p>
diff --git a/files/pt-br/mozilla/tech/xpcom/guide/index.html b/files/pt-br/mozilla/tech/xpcom/guide/index.html
deleted file mode 100644
index 63fcce03c0..0000000000
--- a/files/pt-br/mozilla/tech/xpcom/guide/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: XPCOM guide
-slug: Mozilla/Tech/XPCOM/Guide
-tags:
- - Add-ons
- - Extensions
- - Guide
- - Landing
- - Mozilla
- - NeedsTranslation
- - TopicStub
- - XPCOM
-translation_of: Mozilla/Tech/XPCOM/Guide
----
-<p><span class="seoSummary">These articles provide tutorials and usage documentation for XPCOM, including how to use it in your own projects and how to build XPCOM components for your Firefox add-ons and the like.</span></p>
-
-<div class="warning">
-<p><strong>WebExtensions are becoming the new standard for creating add-ons. </strong>Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions">WebExtensions</a> API, and <a href="https://mzl.la/webext-feature-needed">report any missing functionality</a> so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_XUL_XPCOM_extensions">Comparison with XUL/XPCOM extensions</a>. In addition, any binaries you use will then need to be converted for use with the WebExtensions <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging">native messaging</a> API, or compiled using <a href="https://webassembly.github.io/">WebAssembly</a> or <a href="/en-US/docs/Mozilla/Projects/Emscripten">Emscripten</a>.</p>
-</div>
-
-<p>{{LandingPageListSubpages}}</p>
diff --git a/files/pt-br/mozilla/tech/xpcom/index.html b/files/pt-br/mozilla/tech/xpcom/index.html
deleted file mode 100644
index 07687c0f82..0000000000
--- a/files/pt-br/mozilla/tech/xpcom/index.html
+++ /dev/null
@@ -1,47 +0,0 @@
----
-title: XPCOM
-slug: Mozilla/Tech/XPCOM
-tags:
- - Landing
- - Mozilla
- - NeedsTranslation
- - TopicStub
- - XPCOM
-translation_of: Mozilla/Tech/XPCOM
----
-<p><span class="seoSummary"><strong>XPCOM</strong> is a cross platform component object model, similar to Microsoft COM. It has multiple <a href="/en-US/docs/XPCOM/Language_Bindings" title="XPCOM/Language_Bindings">language bindings</a>, allowing XPCOM components to be used and implemented in JavaScript, Java, and Python in addition to C++.</span> Interfaces in XPCOM are defined in a dialect of IDL called <a href="/en-US/docs/XPIDL" title="XPIDL">XPIDL</a>.</p>
-
-<div class="warning">
-<p><strong>XPCOM is no longer available for use by Firefox extensions. Use <a href="/en-US/Add-ons/WebExtensions">WebExtensions</a> instead.</strong></p>
-</div>
-
-<p>XPCOM itself provides a set of core components and classes, e.g. file and memory management, threads, basic data structures (strings, arrays, variants), etc. The majority of XPCOM components are not part of this core set and are provided by other parts of the platform (e.g. <a href="/en-US/docs/Gecko" title="Gecko">Gecko</a> or <a href="/en-US/docs/Necko" title="Necko">Necko</a>) or by an application or even by an extension.</p>
-
-<div class="row topicpage-table">
- <div class="section"><dl><dl><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Accessing_the_Windows_Registry_Using_XPCOm">Accessing the Windows Registry Using XPCOM</a></dt><dd class="landingPageList">When implementing Windows-specific functionality, it is often useful to access the Windows registry for information about the environment or other installed programs. To this end, there exist <a href="/en/XPCOM" title="en/XPCOM">XPCOM</a> interfaces to read and write registry data. This article will show you how to use the available interfaces in several Mozilla products.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Aggregating_the_In-Memory_Datasource">Aggregating the In-Memory Datasource</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/already_AddRefed">already_AddRefed</a></dt><dd class="landingPageList"><code>already_AddRefed</code> in association with <code><a href="/en-US/docs/NsCOMPtr">nsCOMPtr</a></code> allows you to assign in a pointer <strong>without</strong> <code>AddRef</code>ing it.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Binary_compatibility">Binary compatibility</a></dt><dd class="landingPageList">If Mozilla decides to upgrade to a compiler that does not have the same ABI as the current version, any built component may fail. It is a possiblity that is introduced when upgrading to a new compiler without recompiling everything. Effectively, it is a different platform.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Bundling_multiple_binary_components">Bundling multiple binary components</a></dt><dd class="landingPageList">Binary XPCOM components are sometimes required to implement low-level features for extensions. Since binary components are linked against a single Gecko SDK, a dependency to a particular version of Gecko is created. If the component uses only "frozen" XPCOM interfaces, there is a good chance the same binary component will work with different versions of Gecko (version 1.8 and 1.9, for example). The more likely case is that the component uses "unfrozen" interfaces and those interfaces can change between Gecko versions. This can create a difficult situation for extension developers trying to support multiple Gecko versions (Firefox 2 and 3, for example).</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Creating_a_Python_XPCOM_component">Creating a Python XPCOM component</a></dt><dd class="landingPageList"><a href="http://books.mozdev.org/html"><em>Creating Applications with Mozilla</em></a> already provides <a href="http://books.mozdev.org/html/mozilla-chp-8-sect-2.html">a tutorial</a> for making a simple JavaScript or C++ component (implementing the <code>nsISimple</code> interface). Here is how to make the same component in Python using <a href="/en-US/docs/PyXPCOM" title="PyXPCOM">PyXPCOM</a>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Fun_with_XBL_and_XPConnect">Fun With XBL and XPConnect</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Generating_GUIDs">Generating GUIDs</a></dt><dd class="landingPageList"><strong>GUID</strong>s are used in Mozilla programming for identifying several types of entities, including XPCOM <a href="/en-US/docs/Interfaces">Interfaces</a> (this type of GUIDs is callled IID), components (CID), and legacy add-ons—like <a href="/en-US/docs/Extensions">extensions</a> and <a href="/en-US/docs/Themes">themes</a>—that were created prior to Firefox 1.5. <a href="/en-US/docs/Install_Manifests#id">Add-ons can (and should) be identified with IDs of the form <code><var>extensionname</var>@<var>organization</var>.<var>tld</var></code></a> since <a href="/en-US/docs/Firefox_1.5_for_developers">Firefox 1.5</a>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Generic_factory">Generic factory</a></dt><dd class="landingPageList">Most XPCOM factories can be very simple. Rick Potts wrote a templated-based generic factory (nsFactory&lt;t&gt;) that simplifies the factory creation process that just requires writing a CreateInstance() method. The new nsIGenericFactory interface takes this a step further, by providing a single interface that can be reused anytime a simple implementation of nsIFactory is needed. Here is the interface, and a description of its use.&lt;/t&gt;</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/How_to_build_a_binary_XPCOM_component_using_Visual_Studio">How to build a binary XPCOM component using Visual Studio</a></dt><dd class="landingPageList">This is a simple tutorial for building XPCOM objects in C++ using Visual Studio. XPCOM is Mozilla’s cross platform component object model, similar to Microsoft’s COM technology. XPCOM components can be implemented in C, C++, and JavaScript, and can be used from C, C++, and JavaScript. That means you can call JavaScript methods from C++ and vice versa. For more information on the workings of XPCOM look <a href="en/XPCOM">elsewhere</a>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/How_to_pass_an_XPCOM_object_to_a_new_window">How To Pass an XPCOM Object to a New Window</a></dt><dd class="landingPageList">If you want to be able to call functions within an XPCOM object from a XUL window's code, you can do so if you pass the XPCOM object as one of the arguments to the window creation method.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Interfacing_with_the_XPCOM_cycle_collector">Interfacing with the XPCOM cycle collector</a></dt><dd class="landingPageList">This is a quick overview of the cycle collector introduced into XPCOM for Firefox 3, including a description of the steps involved in modifying an existing C++ class to participate in XPCOM cycle collection. If you have a class that you think is involved in a cyclical-ownership leak, this page is for you.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Introduction_to_XPCOM_for_the_DOM">Introduction to XPCOM for the DOM</a></dt><dd class="landingPageList">Warning: this document has not yet been reviewed by the DOM gurus, it might contain some errors.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Language_Bindings">Language bindings</a></dt><dd class="landingPageList">An <strong>XPCOM Language Binding</strong> is a bridge between a particular language and <a href="/en/XPCOM" title="en/XPCOM">XPCOM</a> to provide access to XPCOM objects from that language, and to let modules written in that language be used as XPCOM objects by all other languages for which there are XPCOM bindings.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Monitoring_HTTP_activity">Monitoring HTTP activity</a></dt><dd class="landingPageList">Gecko includes the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpActivityObserver" title="">nsIHttpActivityObserver</a></code> interface, which you can implement in your code to monitor <a href="/en/HTTP" title="en/HTTP">HTTP</a> transactions in real time, receiving a callback as the transactions take place.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/nsCOMPtr_versus_RefPtr">nsCOMPtr versus RefPtr</a></dt><dd class="landingPageList">Gecko code uses both <code>nsCOMPtr</code> and <code>RefPtr</code> as smart pointers. This guide provides some explanation and advice on how to choose between them.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Observer_Notifications">Observer Notifications</a></dt><dd class="landingPageList">The following are topics that you can observe during the course of an application. Unless otherwise noted you register for the topics using the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIObserverService" title="">nsIObserverService</a></code>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Setting_HTTP_request_headers">Setting HTTP request headers</a></dt><dd class="landingPageList"><a href="/en-US/docs/HTTP">HTTP</a> is one of the core technologies behind the Web. In addition to the actual content, <a href="/en-US/docs/HTTP/Headers">some important information</a> is passed with HTTP headers for both HTTP requests and responses.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Storage">Storage</a></dt><dd class="landingPageList"><strong>Storage</strong> is a <a class="external" href="http://www.sqlite.org/">SQLite</a> database API. It is available to trusted callers, meaning extensions and Firefox components only.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/The_Thread_Manager">The Thread Manager</a></dt><dd class="landingPageList">The Thread Manager, introduced in Firefox 3, offers an easy to use mechanism for creating threads and dispatching events to them for processing.</dd></dl></dl></div>
- <div class="section"><dl><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Troubleshooting_XPCOM_components_registration">Troubleshooting XPCOM components registration</a></dt><dd class="landingPageList">Often the first time you create an XPCOM component, it may fail to register correctly.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_nsCOMPtr">Using nsCOMPtr</a></dt><dd class="landingPageList">This document is the sum total of everything written down about <code>nsCOMPtr</code>. If you have a question about <code>nsCOMPtr</code>, and this document doesn't answer it, there probably isn't a document that answers it. You'll have to turn to <a class="external" href="news:mozilla.dev.tech.xpcom">the XPCOM newsgroup</a> or another experienced <code>nsCOMPtr</code> user, or find the answer by experimentation.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_nsIClassInfo">Using nsIClassInfo</a></dt><dd class="landingPageList">If you use a C++ class which implements <code>nsIClassInfo</code> from JavaScript, then you don't have to explicitly call <code>QueryInterface</code> on the JavaScript object to access the object's interfaces.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_nsIDirectoryService">Using nsIDirectoryService</a></dt><dd class="landingPageList">nsDirectoryService implements the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProperties" title="">nsIProperties</a></code> interface. This implementation will allow you to <code>Get()</code>, <code>Set()</code>, <code>Define()</code>, and <code>Undefine()</code> <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_nsIPasswordManager">Using nsIPasswordManager</a></dt><dd class="landingPageList">Technical review completed.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_nsISimpleEnumerator">Using nsISimpleEnumerator</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_the_clipboard">Using the clipboard</a></dt><dd class="landingPageList">This section provides information about cutting, copying, and pasting to and from the clipboard.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_the_Gecko_SDK">Using the Gecko SDK</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Weak_reference">Weak reference</a></dt><dd class="landingPageList">In <a href="/en-US/docs/XPCOM">XPCOM</a>, a <strong>weak reference</strong> is a special object that contains a pointer to an XPCOM object, but does<em>not</em> keep that object alive. If the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to <code>nsnull</code>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Working_with_multiple_versions_of_interfaces">Working with Multiple Versions of Interfaces</a></dt><dd class="landingPageList">In this short note we illustrate how one can update an XPCOM module in
-order for it to work in both Firefox 2 and Firefox 3, even if the interfaces have
-changed in the interim.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Working_with_out_parameters">Working with out parameters</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/wrappedJSObject">wrappedJSObject</a></dt><dd class="landingPageList"><code>wrappedJSObject</code> is a property sometimes available on <a href="en/XPConnect">XPConnect</a> wrappers. When available, it lets you access the JavaScript object hidden by the wrapper.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/XPCOM_ABI">XPCOM ABI</a></dt><dd class="landingPageList"><a href="/en/XPCOM" title="en/XPCOM">XPCOM</a> <abbr title="Application Binary Interface">ABI</abbr> is the binary interface of XPCOM components. While XPCOM components written in a scripting language (such as <a href="/en/JavaScript" title="en/JavaScript">JavaScript</a>) can be moved across platforms (such as Windows and OS X) without adaptation, those written in a compiled language (such as C++) require recompilation when moving to a different platform. Often, compiled XPCOM components are called 'binary' or 'native'.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/XPCOM_category_image-sniffing-services">XPCOM category image-sniffing-services</a></dt><dd class="landingPageList">In versions of Firefox prior to Firefox 3, extensions could add decoders for new image types. However, such decoders relied on servers sending correct MIME types; images sent with incorrect MIME types would not be correctly displayed.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Glue">XPCOM glue</a></dt><dd class="landingPageList">The XPCOM Glue is a static library which component developers and embedders can link against. It allows developers to link only against the frozen XPCOM method symbols and maintain compatibility with multiple versions of XPCOM.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Guide">XPCOM guide</a></dt><dd class="landingPageList">These articles provide tutorials and usage documentation for XPCOM, including how to use it in your own projects and how to build XPCOM components for your Firefox add-ons and the like.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/XPCOM_ownership_guidelines">XPCOM ownership guidelines</a></dt><dd class="landingPageList">...naturally. If you create a temporary object, obviously it's up to you to destroy it. That's a sure sign of ownership. If you create an object with a longer lifespan, you will own it until you give ownership away.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference">XPCOM reference</a></dt><dd class="landingPageList">This reference describes the interfaces and functions provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM">XPCOM</a> library. In addition, it details the various helper classes and functions, as well as the components, provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM/Glue">XPCOM glue</a> library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/XPCOM_tasks">XPCOM tasks</a></dt><dd class="landingPageList">The XPCOM module roughly parallels the C/C++ standard libraries. It overlaps them significantly, but goes beyond them in capabilities. XPCOM sits above the standard libraries. Its role is to extend them with facilities tailored to XPCOM development in general, and specifically the needs of Mozilla. Like the standard libraries, XPCOM must be a fairly self-contained library, so as not to encumber clients with any unnecessary external dependencies.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Thread_synchronization">XPCOM Thread Synchronization</a></dt><dd class="landingPageList">XPCOM thread synchronization primitives have the same semantics as those in NSPR, and each method of these synchronization objects (e.g. <code>Mutex::Lock()</code>) has a matching function in NSPR (<code>PR_Lock()</code>). This is no accident, as mozilla:: primitives are merely bare-minimum wrappers around NSPR's.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/xptcall_FAQ">xptcall FAQ</a></dt><dd class="landingPageList"><code>xptcall</code> is a small low level XPCOM method call library. It is implemented using platform specific C/C++ and assembly language code. It is used to facilitate cross language and cross thread method calls. Porting this code is required in order to make Mozilla run on any given platform.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/xptcall_porting_guide">Xptcall Porting Guide</a></dt><dd class="landingPageList">Original Author: John Bandhauer, 31 May 1999.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/xptcall_porting_status">Xptcall Porting Status</a></dt><dd class="landingPageList">This is a status page for the multiplatform porting of xptcall. xptcall has a <a href="/En/Xptcall_FAQ">FAQ</a> and a <a href="/En/Xptcall_Porting_Guide">Porting Guide</a>.</dd></dl></div>
- </div>
-
-<div class="blockIndicator communitybox" dir="ltr">
-
- <div class="column-container">
- <h2 id="Join_the_XPCOM_community">Join the XPCOM community</h2>
- <div class="column-half">
- <div class="communitysubhead">Choose your preferred method for joining the discussion:</div>
- <ul class="communitymailinglist">
- <li><a href="https://lists.mozilla.org/listinfo/dev-tech-xpcom">Mailing list</a></li>
-
-
- <li><a href="http://groups.google.com/group/mozilla.dev.tech.xpcom">Newsgroup</a></li>
- <li><a href="http://groups.google.com/group/mozilla.dev.tech.xpcom/feeds">RSS feed</a></li>
-</ul>
- </div>
- <div class="column-half">
- <ul class="communitycontact"><li><strong>IRC: </strong><a href="irc://irc.mozilla.org/developers">#developers</a> <span class="smaller">(<a href="https://wiki.mozilla.org/IRC">learn more</a>)</span></li><li><strong>Tools: </strong><a href="http://ted.mielczarek.org/code/mozilla/jscomponentwiz/">JavaScript Component Wizard</a>, <a href="http://www.mytools360.com-a.googlepages.com/home#XPComPro">Visual C++ Component Wizard</a>, <a href="http://www.yutools.com/wp/tools/yuxpcomwizard/?lang=en">Visual C++ Component Wizard for Visual Studio 2010</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/xpcomviewer/">XPCOMViewer addon: browse XPCOM interfaces easily</a></li></ul>
- </div>
- </div>
-</div>
-
-<section id="Quick_Links"><ol><li><a href="http://www.ibm.com/developerworks/library/os-xpcomfirefox/">Tutorial from IBM DeveloperWorks</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System">Binary components tutorial</a></li><li><a href="http://www.iosart.com/firefox/xpcom/">Linux and Windows how-to guide</a></li><li><a href="http://starkravingfinkle.org/blog/2006/10/mozilla-platform-xpcom-in-c/">Windows example blog post</a></li><li><a href="http://wanderingstan.com/2007-11-16/geekout_how_to_make_a_c_xpcom_component">Another Windows example</a></li><li><a href="http://rcrowley.org/2007/07/17/cross-platform-xpcom-a-howto.html">Mac OS X example</a></li><li><a href="/en-US/docs/Web/JavaScript" title="JavaScript (JS) is a lightweight interpreted or JIT-compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat.">JavaScript</a></li></ol></section>
diff --git a/files/pt-br/mozilla/tech/xpcom/reference/index.html b/files/pt-br/mozilla/tech/xpcom/reference/index.html
deleted file mode 100644
index 3d8f2b9b64..0000000000
--- a/files/pt-br/mozilla/tech/xpcom/reference/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: XPCOM reference
-slug: Mozilla/Tech/XPCOM/Reference
-tags:
- - Landing
- - Mozilla
- - NeedsTranslation
- - Reference
- - TopicStub
- - XPCOM
-translation_of: Mozilla/Tech/XPCOM/Reference
----
-<p>This reference describes the interfaces and functions provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM">XPCOM</a> library. In addition, it details the various helper classes and functions, as well as the components, provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM/Glue">XPCOM glue</a> library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.</p>
-<div class="note">
- <p><strong>Note:</strong> If you're working on a module in the Mozilla codebase that's compiled with the <code>MOZILLA_INTERNAL_API</code> flag set, some of these APIs -- the string functions and classes in particular -- are not the ones you should be using. See the <a href="/en-US/docs/Mozilla/Tech/XPCOM/Guide/Internal_strings">XPCOM internal string guide</a> for documentation of the internal string API used within the Mozilla codebase.</p>
-</div>
-<p>{{LandingPageListSubpages}}</p>
-<p>Many XPCOM pages return an <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Core_functions/nsresult">nsresult</a></code>. Prior to Gecko 19 {{geckoRelease(19)}}, this was an integer that simply returned an error code. It is now a strongly typed <code>enum</code> when XPCOM is built using a C++11 compiler. This causes compile-time errors to occur when improper values are returned as nsresult values, thereby making it easier to catch many bugs.</p>
diff --git a/files/pt-br/mozilla/tech/xpcom/reference/interface/index.html b/files/pt-br/mozilla/tech/xpcom/reference/interface/index.html
deleted file mode 100644
index 9adc0e0157..0000000000
--- a/files/pt-br/mozilla/tech/xpcom/reference/interface/index.html
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: XPCOM Interface Reference
-slug: Mozilla/Tech/XPCOM/Reference/Interface
-tags:
- - NeedsTranslation
- - TopicStub
- - XPCOM
- - XPCOM Interface Reference
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface
----
-<p>This is a reference to the XPCOM interfaces provided by the Mozilla platform.</p>
-<div class="cols-3">
- {{tree('','1')}}</div>
-<h2 id="See_also" name="See_also">See also</h2>
-<ul>
- <li><a href="/en-US/docs/XPCOM_Interface_Reference_group" title="XPCOM_Interface_Reference_group">Interfaces grouped by function</a></li>
-</ul>
diff --git a/files/pt-br/mozilla/tech/xpcom/reference/interface/nsidevicemotion/index.html b/files/pt-br/mozilla/tech/xpcom/reference/interface/nsidevicemotion/index.html
deleted file mode 100644
index 4eef5f2942..0000000000
--- a/files/pt-br/mozilla/tech/xpcom/reference/interface/nsidevicemotion/index.html
+++ /dev/null
@@ -1,129 +0,0 @@
----
-title: nsIDeviceMotion
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIDeviceMotion
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDeviceMotion
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/system/nsIDeviceMotion.idl" rel="custom">xpcom/system/nsIDeviceMotion.idl</a></code><span style="text-align: right; float: right;"><a href="/en-US/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">Scriptable</a></span></div>
-<span style="padding: 4px 2px;">
-
-Essa interface é usada para implementar o suporte acelerômetro.
-</span>
-
- <div style="height: 42px; position: relative; padding: 2px; width: auto;">
-
- <div style="top: 22px; font-size: 11px; position: absolute;">1.0</div>
-
- <div style="top: 22px; font-size: 11px; position: absolute; left: 0px; text-align: right; float: right; width: 100%;">66</div>
-
- <div style="height: 8px; top: 16px; background: #dd0000; left: 0px; position: absolute; width: 10.476190285714287%;"></div>
-
-<div style="height: 8px; top: 16px; left: 10.476190285714287%; background: #00dd00; position: absolute; width: 89.52380971428572%;" title="Introduced in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)"></div>
-
-<div style="top: 0px; font-size: 11px; position: absolute; left: 10.476190285714287%;">Introduced</div>
-<div style="top: 22px; font-size: 11px; position: absolute; left: 10.476190285714287%;">Gecko 1.9.2</div>
-
- <div style="height: 8px; top: 16px; left: 13.785714285714285%; background: #eeee00; position: absolute; width: 1%; border-radius: 4px; -webkit-border-radius: 4px;" title="Last changed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)"></div>
-
-</div>
-
-<div style="background: #eee; padding: 2px;">
-Inherits from: <code><a href="/pt-BR/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">Last changed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)</span></div>
-</div><p></p>
-
-<div class="note"><strong>Note:</strong> This interface was named <code>nsIDeviceMotion</code> prior to Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3).</div>
-
-<h2 id="Method_overview" name="Method_overview">Visão Geral</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="#addListener()">addListener</a>(in nsIDeviceMotionListener aListener);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#addWindowListener()">addWindowListener</a>(in nsIDOMWindow aWindow);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="#removeListener()">removeListener</a>(in nsIDeviceMotionListener aListener);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#removeWindowListener()">removeWindowListener</a>(in nsIDOMWindow aWindow);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Methods" name="Methods">Métodos</h2>
-
-<h3 id="addListener()" name="addListener()">addListener()</h3>
-
-<p>Quando chamado, a implementação do suporte acelerômetro deve começar a notificar o que foi especificado <code><a href="/pt-BR/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDeviceMotionListener" title="">nsIDeviceMotionListener</a></code> chamando seu <code><a href="https://developer.mozilla.org/pt-BR/docs/XPCOM_Interface_Reference/nsIDeviceMotionListener#onAccelerationChange()">nsIDeviceMotionListener.onAccelerationChange()</a></code> método apropriado para compartilhar dados de aceleração atualizados.</p>
-
-<pre class="eval">void addListener(
- in nsIDeviceMotionListener aListener
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parâmetro</h6>
-
-<dl>
- <dt><code>aListener</code></dt>
- <dd>O <code><a href="/pt-BR/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDeviceMotionListener" title="">nsIDeviceMotionListener</a></code> objeto cujo <code><a href="https://developer.mozilla.org/pt-BR/docs/XPCOM_Interface_Reference/nsIDeviceMotionListener#onAccelerationChange()">nsIDeviceMotionListener.onAccelerationChange()</a></code> método deve ser chamado com dados de aceleração atualizados.</dd>
-</dl>
-
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="addWindowListener">addWindowListener</h3></div><p></p>
-
-<p>Definir o <code>nsIAccelerometer</code> da raiz para <code>MozOrientation</code> eventos sobre um específico DOM <a href="/pt-BR/docs/Web/API/Window" title="O objeto window representa uma janela que contém um elemento DOM; a propriedade document aponta para o documento DOM document carregado naquela janela."><code>window</code></a>.</p>
-
-<pre class="eval">void addWindowListener(
- in nsIDOMWindow aWindow
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parâmetro</h6>
-
-<dl>
- <dt><code>aWindow</code></dt>
- <dd><span id="result_box" lang="pt"><span>A janela de</span> <span>DOM</span> <span>que o</span> <span>acelerômetro</span> <span>deverá</span> <span>começar a enviar</span></span> para o evento <code>MozOrientation</code>.</dd>
-</dl>
-
-<h3 id="removeListener()" name="removeListener()">removeListener()</h3>
-
-<p><span id="result_box" lang="pt"><span>Diz</span> a<span>o acelerômetro para</span> <span>parar de enviar</span> <span>atualizações para o</span> quem foi <span>especificado</span></span> <code><a href="/pt-BR/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDeviceMotionListener" title="">nsIDeviceMotionListener</a></code>.</p>
-
-<pre class="eval">void removeListener(
- in nsIDeviceMotionListener aListener
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parâmetro</h6>
-
-<dl>
- <dt><code>aListener</code></dt>
- <dd>O <code><a href="/pt-BR/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDeviceMotionListener" title="">nsIDeviceMotionListener</a></code> <span id="result_box" lang="pt"><span>objeto para o qual</span> <span>não há</span> <span>mais atualizações</span> para <span>serem enviadas.</span></span></dd>
-</dl>
-
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="removeWindowListener">removeWindowListener</h3></div><p></p>
-
-<p>Remover o <code>nsIAccelerometer</code> como fonte para o evento <code>MozOrientation</code> de um DOM especificado <a href="/pt-BR/docs/Web/API/Window" title="O objeto window representa uma janela que contém um elemento DOM; a propriedade document aponta para o documento DOM document carregado naquela janela."><code>window</code></a>.</p>
-
-<pre class="eval">void removeWindowListener(
- in nsIDOMWindow aWindow
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parâmetro</h6>
-
-<dl>
- <dt><code>aWindow</code></dt>
- <dd><span id="result_box" lang="pt"><span>A janela de</span> <span>DOM</span> <span>que o</span> <span>acelerômetro</span> <span>deve</span> <span>parar de enviar</span></span> <code>para o evento MozOrientation</code>.</dd>
-</dl>
-
-<h2 id="See_also" name="See_also">Veja também</h2>
-
-<ul>
- <li><a href="/en/DOM/MozOrientation" title="en/DOM/MozOrientation"><code>MozOrientation</code></a></li>
- <li><code><a href="/pt-BR/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMOrientationEvent" title="">nsIDOMOrientationEvent</a></code></li>
- <li><code><a href="/pt-BR/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDeviceMotionData" title="">nsIDeviceMotionData</a></code></li>
- <li><code><a href="/pt-BR/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDeviceMotionListener" title="">nsIDeviceMotionListener</a></code></li>
-</ul>