Revision 98948 of XEmbed Extension for Mozilla Plugins

  • Revision slug: XEmbed_Extension_for_Mozilla_Plugins
  • Revision title: XEmbed Extension for Mozilla Plugins
  • Revision id: 98948
  • Created:
  • Creator: Josh
  • Is current revision? No
  • Comment
Tags: 

Revision Content

Overview

Recent versions of Mozilla include an extension for writing plugins that use XEmbed instead of using the old Xt-based mainloop that most plugins have been using since the Netscape 3.x days.

The use of the Xt mainloop has been a problem for modern plugin development because very few modern applications that want to take advantage of the capabilities of newer toolkits use Xt. Also, when included with builds of Mozilla that are based on Gtk 1.2 or Gtk 2.x, the Xt code that hosts the plugins is at best hacky and has been the source for many minor problems including inconsistent focus behavior as well as occasional crashes.

It's recommended that you have a look at the Gecko Plugin API Reference since this document will include information that assumes that you are already familiar with the way that plugins are currently hosted as well as the APIs.

Key Differences

All of the interfaces that you would normally expect to exist in the plugins will still exist when using XEmbed plugins. There are only two key differences:

  • In the NPP_SetWindow call, the window parameter will be the XID of the hosting XEmbed window. As an implementation note, this is really the XID of a GtkSocket window.
  • In your Plugin Instance NPP_GetValue call you need to make sure that you support the new NPPVpluginNeedsXEmbed value. More information is included on this below.

Revision Source

<h2 name="Overview">Overview</h2>
<p>Recent versions of Mozilla include an extension for writing plugins that use XEmbed instead of using the old Xt-based mainloop that most plugins have been using since the Netscape 3.x days.
</p><p>The use of the Xt mainloop has been a problem for modern plugin development because very few modern applications that want to take advantage of the capabilities of newer toolkits use Xt. Also, when included with builds of Mozilla that are based on Gtk 1.2 or Gtk 2.x, the Xt code that hosts the plugins is at best hacky and has been the source for many minor problems including inconsistent focus behavior as well as occasional crashes.
</p><p>It's recommended that you have a look at the <a href="en/Gecko_Plugin_API_Reference">Gecko Plugin API Reference</a> since this document will include information that assumes that you are already familiar with the way that plugins are currently hosted as well as the APIs.
</p>
<h2 name="Key_Differences">Key Differences</h2>
<p>All of the interfaces that you would normally expect to exist in the plugins will still exist when using XEmbed plugins. There are only two key differences:
</p>
<ul><li> In the NPP_SetWindow call, the window parameter will be the XID of the hosting XEmbed window. As an implementation note, this is really the XID of a <a class="external" href="http://developer.gnome.org/doc/API/2.0/gtk/GtkSocket.html">GtkSocket</a> window.
</li><li> In your Plugin Instance NPP_GetValue call you need to make sure that you support the new NPPVpluginNeedsXEmbed value. More information is included on this below.
</li></ul>
Revert to this revision