Plugin for webbrowsers

  • rkd77

    rkd77 - 2011-01-17

    A few years ago I had an idea to write a plugin for the Mozilla based on fuse. I wrote something . This is the old code adjusted to the libspectrum-1.0.0.
    This code has bad timing, is messy and outdated.
    I think about refreshing this idea.
    It would be nice if such a feature - the plugin handling .tap, .tzx, .z80, .rzx and others had implemented in the mainstream fuse-emulator.
    I've ideas how to do that:
    1) first refactor code of fuse (replace global and static variables with structs (global for the moment)). For example in display.c:
    Instead of:
    int display_ui_initiliased;

    static libspectrum_dword display_last_screen;

    in display.h:
    struct display {
      int display_ui_initialised;

       libspectrum_dword display_last_screen;

    extern struct display display;
    In the rest of the code all occurrences of display_ui_initialised changed to display.display_ui_initialised, and so on for all files.
    This change should have no impact on the performance.
    2) add the first parameter to all functions, something like 'this' in C++, all global structs replace with one allocated struct fuse containing other structs, and use that mentioned parameter:
    struct fuse {
      struct display display;
      struct machine machine;
    … and so on
    struct fuse *fuse = calloc(1, sizeof(*fuse));
    display.display_ui_initialised would become fuse->display.display_ui_initialised and other structs the same way
    After these changes the code would be a few percent slower, but the code for plugin could be written easier.
    One tarball could contain the code for the fuse-emulator and the fuse-plugin for webbrowsers.

    I hope you agree that such plugin would be fine.
    I could sent you patches for steps 1,2 and 3. 3 is the code for the plugin.

  • rkd77

    rkd77 - 2011-04-30

    Well, there is the mozplugger which can change any Unix program into plugin.
    Here is an example configuration (a fragment of /etc/mozpluggerrc) for fuse to play z80 files:
    application/x-z80:z80:Z80 file
            noisy swallow(Fuse): fuse "$file"


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks