Shotgun Marrige of Gtk/Gdk with Xt/Motif --or-- How I learned to stop worrying about and love Mozilla



For better or for worse I've just recently agreed to start working on legacy
plug-in support for Linux/Gtk Mozilla.  After I started looking into the
requirments, I realized why no one has done this yet - it's going to be a
bloody mess of a hack.

The problem:

Implementing Netscape legacy plug-in support for Linux/Gtk requires a strange
marrige of toolkits - that is Gtk/Gdk with Xt/Motif.  The old Netscape plug-ins
assumed that the Xt environment has been initialize before the plug-in code
starts to be executed.  The code is handed a special Netscape window structure
that contains all the basic window info needed (like the XLib window ID,
Colormap, and Display pointer) with a Xt Widget already created for the window.
Netscape then takes a hands off approach to the plug-in window, leaving the
plug-in code to take care of itself.

And of course, implementing legacy plug-in support also means that I wouldn't
have access to the plug-in code.  It means that I could take things like the
current Flash Netscape plug-in binary, move it to the Mozilla plug-in directory,
and everything works.

Possible solution:

What if a new Gtk widget, like GtkXtWidget, were added that would fake
out the Xt dependent code.? It would have to fill out what ever structures the
Xt calls were expecting, and wrap the event handling with gdk event handling.
If this extension existed, I could easily change the Mozilla legacy plug-in
wrapper code to create a new GtkXtWidget for the plug-in window.  Then any
calles like XtWindowToWidget(window, display) would return a pointer to the Xt
Widget structure created by the gtk_xtwidget_new call. 

I was just browsing through the Qt source and it looks like there already is
some special classes for doing this sort of thing with Qt.  Although, it looks
like they require a different initialization call on application startup.  So,
maybe just creating a GtkXtWidget wouldn't be enough?  Maybe a special
gtk_xt_init() call would have to used also? (And no,  moving to the Qt
version of Mozilla isn't  one of my options.)

Anyone every try this sort of thing?  Anyone have a better idea?  If not then
it looks like I'm about to put myself through a crash course on the bowles of
Xt.

	-Rusty Lynch
              HOME: rusty.lynch@bbnow.net
	  WORK: rusty.lynch@intel.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]