A Generic Plugin for Unix Netscape What is it X Swallow is a plugin ive cobbled together to allow any X program to be used as an inline viewer for any appropiate mime type. So a mime type like vrml for which there does not exist, as of the moment, a plugin for linux netscape can be viewed inline to netscape with ordinary vrml viewers such as vrweb/liquid reality. Also it has all the abilities of mimeplugin by Carl Shimer & Michael J Long on which Xswallow is based and can be therefore be used to handle mimetypes that are handled by programs with no graphical interface, audio formats for the most part. The mimetypes i use it for myself are vrml/mpeg and audio formats, you might find Plugger, UMP(for midi really) and MpegTV (mpeg, but troublesome with netscape 4) more appropiate for other types. Last bugfixes were to remove the moronic bug i put in it when i was fixing the last bugs that made it crash loadsa times Previous bugfixes were to make it work correctly with WindowMaker, stop crashing on leaving an audio page, and another bug fix or two (btw i know that running netscape -install will make the plugin use wrong colors and stuff, ill have that all working soon, soon i tell you) Im feeling pretty confident now that this thing works reliably, so if it crashes, does something particularly silly or doesnt compile on your platform, tell me, (sending me fixes is good) What do i need An X viewer or interfaceless program for that mimetype and the xswallow plugin for your platform. netscape3.01 and 4.03 both work without problems Heres a picture of it doing its thing. How do i set it up * 1) Get the ordinary viewers, make sure they work * 2) copy the plugin to your .netscape/plugins directory * 3) copy the xswallow.conf to your .netscape directory and edit it appropiately. * 4) if you use dispatch-vrml-c, edit the first couple of lines to reflect your site's setup Each mime type in the file is as follows. # MIME type Extensions Command SwallowName Description x-world/x-vrml; vr,wrl; /home/caolan/bin/dispatch-vrml-c %s %u &w %h ; "VRweb Scene Viewer" "Applet Viewer" ; Embedded Vrml First the mime type section, then the extensions section, Thats all fairly handy and straightforward. Then theres the command to be run to handle that type. * %s is replaced by the plugin with the filename to run the application on * %u is replaced by the url thats being accesses * %w is the width that netscape has provided for the plugin * %h is the height that netscape has provided for the plugin For the most part the only one of these you proably need to use usually is %s and maybe %u on ocassion See problems for why i have dispatch-vrml-c as my vrml viewer. Now the catchy bit. The SwallowName is the name that your windowmanager displays in the title bar of the application that you will be running, The xswallow plugin will match the word shown here against the beginning of the string displayed in the titlebar so for example. the swallowname "VRweb Scene Viewer" will match against the displayed "VRweb Scene Viewer: random.wrl". There can be multiple names listed in this section seperated by spaces. If the program to be used is not an X program or you dont want the X program to be relocated then leave this section blank. As an example if you use an X program to handle sound, you really shouldnt fill in the swallowname, as many pages put embedded midi etc in a nominally sized plugin-space, e.g 1x1 and if swallowed most X programs will be pretty useless at such a size. The last field is just a description field to be displayed in the about:plugins display of netscape. My xswallow.conf Basically it will now all work happily. You may have to go to the netscape preferences window and manually set netscape to use the plugin for the various embedded type as well. And if add new types to the xswallow.conf you'll have to delete plugin-list and plugin-list.BAK to get netscape to reregister the new types. Another point is that if you dont have a xswallow.conf, Xswallow will appear not to exist at all, i.e it wont show up on the about:plugins Now on to some more details to make the setup easier to live with. ----------------------------------------------------------------- Fixes for Annoyances with XSwallow The plugin runs the application, waits for the a window with the swallowname title to appear, and then relocates it into the space provided in netscape. The issues relating to this are * 1) If for instance you have vrweb as the command then vrweb will popup on screen for a sec and then relocate, which is a highly annoying behaviour, especially if you have a windowmanager that makes you place an application on screen when it first appears. To overcome this use vrweb -geometry 80x80+9000+9000 This makes vrweb popup automatically without having to locate the box on screen manually for all windowmangers i am aware of, also it is located way off to the right and down, off screen. For most windowmangers this means that you'll not see the original popup of the application. So that'll avoid the annonyance of the reshuffling that xswallow does. Also for most users vrweb -iconic would start it as an icon, so if you have a windowmanger that doesnt allow a application to be started off screen, i suggest you try this method, (note for fvwm95 users that the iconic method should not be used, instead use the geometry method, due to some wierdness i havent worked out) * 2) Because the plugin searches for an app with the registered title to swallow, if a currently running application has that name then it will be swallowed instead !!, thats bad, but this can be overcome for most X apps by adding a -name commandline option e.g xv -name barf & and then setting the swallowname to barf (or some other unique name), nullifying the issue of xswallow relocating the incorrect window. Some problems I havent got fixes for (and think aren't my fault) * 1) Alas the applications that i personally use for the plugins are vrweb/liquid reality and xanim. None of which allow me to change the name of the title bar via the -name method. So i run the risk of swallowing the wrong window if im already running vrweb/lr or xanim and xswallow suddenly needs to find one of these window names, but i find in practice that for me it all works out pretty ok. * 2) There doesnt appear to be a vrml viewer for linux that does vrml1 and vrml2, there one for each, so i use a script called dispatch-vrml-c to distinguish between the two types and to run the appropiate program. Its based on dispatch-vrml by Johan Hagman (Johan.Hagman@mailbox.swipnet.se), and tweaked to suit the architecture of the plugin. It does some useful stuff, sets the size of the appletviewer that lr uses to the size of the space provided and sorts out a few other issues. You'll have to edit the first 3 lines or so for your site. * 3) If you use netscape 3 and load a page with embedded audio that uses the hidden flag, for some fool reason the plugin doesnt even get loaded to deal with the audio, under netscape4 everything is hunky-dory. Why ?, i havent a notion, The plugin doesnt even get loaded so i tentively am claiming that its not my fault. ----------------------------------------------------------------- Download Plugin * Linux compiled version 1.0.10 * Linux intel architecture compiled rpm version 1.0.10 * Src rpm version 1.0.10 * FreeBSD compiled version 1.0.10, courtesy Vladimir Kushnir * SunOS 5.5.1 compiled version 1.0.10 on an ultra-2 * hpux 10.20 compiled version 1.0.10, courtesy Bjorn Wennberg * Source for everyone else (1.0.10). If you compile it for a platform not listed here, could you mail me that compiled version, and whatever fixes had to be made to the makefile/source (if any) Test Plugin * vrml1 test * vrml2 test * midi test * sun audio test * mpeg test The apps i use for XSwallow * Vrweb 1.5 for vrml1 * Liquid Reality for vrml * dispatch-vrml-c to run the above, included in plugins distribution * Playmidi for midi * xanim for mpeg and other video formats more info on this swallowing jazz. --------------------------------------------------------------------------- [Caolán's Home Page] [Skynet Home Page] --------------------------------------------------------------------------- [HTML HaL Mozilla Checked!] [Bandwidth Preservation Society] Pagemaster C.