title: Writing a Firefox XPCOM plug-in with a native window interface? (like ActiveX control)
body: <p>I have an ActiveX control that works fine in Internet Explorer and the ActiveX Control Test Container program. The actual behavior of the control is split in two parts, where one part is the ATL gunk that interfaces with the OLE host, and the other part is the real meat, which just receives callbacks for window attach, sizing, drawing and mouse/keyboard events. </p>
  
  <p>Now, I want to write the equivalent of the ATL gunk, for a Firefox plug-in (ideally in the same binary, so I don't need to link two binaries, but I can be flexible here). I have downloaded and used the Gecko SDK to build an XPCOM component, and that seems to work, but I can't figure out which interfaces to implement to make the component available as an embedded native UI component in Firefox. This is similar in needs to the Flash player plug-in, PDF Viewer plug-in, QuickTime player plug-in, etc -- javascript and XUL won't be enough.</p>
  
  <p>I've looked for examples on the web, but the only examples I can find are based on the seemingly ancient NS_PluginInitialize() / NS_NewPluginInstance() interface, which is not XPCOM (but has some other name?).</p>
  
  <p>Is there a way to achieve the same thing through XPCOM? If so, how? And does there exist any overview documentation at all (not just interface member listings) about how to go about doing this?</p>