DeveloperNotes

History Key

  • New content
  • Removed content

Recent Versions

Choose two versions to compare, or click the link to view it.

  1. 66. about 1 year by SteveLee
  2. 65. about 1 year by SteveLee
  3. 64. about 1 year by SteveLee
  4. 63. over 1 year by SteveLee
  5. 62. over 1 year by SteveLee
  6. 61. over 1 year by SteveLee
  7. 60. over 1 year by SteveLee
  8. 59. over 2 years by SteveLee
  9. 58. over 2 years by SteveLee
  10. 57. over 2 years by SteveLee
  11. 56. over 2 years by SteveLee
  12. 55. over 2 years by SteveLee
  13. 54. over 2 years by SteveLee
  14. 53. over 2 years by SteveLee
  15. 52. over 2 years by SteveLee
  16. 51. over 2 years by SteveLee
  17. 50. over 2 years by SteveLee
  18. 49. over 2 years by SteveLee
  19. 48. over 2 years by SteveLee
  20. 47. over 2 years by SteveLee
  21. 46. over 2 years by SteveLee
  22. 45. over 2 years by SteveLee
  23. 44. over 2 years by SteveLee
  24. 43. over 2 years by SteveLee
  25. 42. over 2 years by SteveLee
  26. 41. over 2 years by SteveLee
  27. 40. almost 3 years by SteveLee
  28. 39. almost 3 years by SteveLee
  29. 38. almost 3 years by SteveLee
  30. 37. almost 3 years by SteveLee
  31. 36. almost 3 years by SteveLee
  32. 35. almost 3 years by SteveLee
  33. 34. almost 3 years by SteveLee
  34. 33. almost 3 years by SteveLee
  35. 32. almost 3 years by SteveLee
  36. 31. almost 3 years by SteveLee
  37. 30. almost 3 years by SteveLee
  38. 29. almost 3 years by SteveLee
  39. 28. almost 3 years by SteveLee
  40. 27. almost 3 years by SteveLee
  41. 26. almost 3 years by SteveLee
  42. 25. almost 3 years by SteveLee
  43. 24. almost 3 years by SteveLee
  44. 23. almost 3 years by SteveLee
  45. 22. almost 3 years by SteveLee
  46. 21. almost 3 years by SteveLee
  47. 20. almost 3 years by SteveLee
  48. 19. almost 3 years by SteveLee
  49. 18. almost 3 years by SteveLee
  50. 17. almost 3 years by SteveLee
  51. 16. almost 3 years by SteveLee
  52. 15. almost 3 years by SteveLee
  53. 14. almost 3 years by SteveLee
  54. 13. almost 3 years by SteveLee
  55. 12. almost 3 years by SteveLee
  56. 11. almost 3 years by SteveLee
  57. 10. almost 3 years by SteveLee
  58. 9. over 3 years by SteveLee
  59. 8. almost 4 years by SteveLee
  60. 7. almost 4 years by SteveLee
  61. 6. almost 4 years by SteveLee
  62. 5. almost 4 years by SteveLee
  63. 4. almost 4 years by SteveLee
  64. 3. almost 4 years by SteveLee
  65. 2. almost 4 years by SteveLee
  66. 1. almost 4 years by SteveLee
 

Maavis is a Firefox extension and so uses many of the Mozilla platform technologies. It also includes a ‘server’ written in Python. For general information on developing extensions MDC Extensions and especially Setting up. See DesignNotes for a description of the architecture.

There are 2 levels of developer

  • Developers – reasonably experienced. Ability to create new web pages uses XUL (like HTML), Javascript and CSS.
  • Core developers – very experienced – as developers but for platform core, plus possibly Python for Skype integration, C for XPCOM components, Inno setup for installer

Contact us

The primary contact route is to send an email to the Maavis Google Group.

Detailed developer set up instructions

There are a few components to install and configure. For convenience correct versions of the various dependencies can be found here. For now the source must be fetched from subversion but tarballs will be provided soon.

  • Install a svn client. E.g. Sliksvn command line client package or TortoiseSVN GUI which integrates with Windows Explorer ;
  • Optionally install MinGW and MSYS if you appreciate a Linux style shell (note the Mozilla build system also includes these).
  • Checkout the Maavis code from svn, you most likely want trunk.;
  • Optionally install the expanded sample MaavisMedia (45Mb zip) folder to %HOMEPATH%\documents;
  • Install and test the correct Firefox version;
  • Run Firefox with following options using a new shortcut called something like ‘MaavisDev’ or the command line (use: start "" command)
    "%ProgramFiles%\Mozilla Firefox\firefox.exe" -nokiosk -no-remote -quickstart -P MaavisDev
    The -no-remote allows you to run Maavis alongside your usual Firefox instance, -nokiosk leaves all Firefox UI visible, while -quickstart skips the splash screen and startsound for faster debugging. The first run you will need to create the MaavisDev profile and may want to specify the location to be in your workspace to ensure it doesn’t get deleted if you uninstall Firefox.
  • Exit Firefox and open the MaavisDev profile folder. Unless you specified a folder when you created the profile it will be something like
    C:\Users\Steve\AppData\Roaming\Mozilla\Firefox\Profiles\14g3opw0.MaavisDev and in the extensions folder create a file maavis@fullmeasure.co.uk which contains the path to the extension folder of the Maavis code. E.g. C:\Users\Steve\projects\Maavis\extension\ NB the trailing \;
  • Add the following to your prefs.js in the profile folder
    user_pref("browser.dom.window.dump.enabled", true);
    user_pref("javascript.options.showInConsole", true);
    user_pref("javascript.options.strict", true);
    user_pref("nglayout.debug.disable_xul_cache", true);
    user_pref("nglayout.debug.disable_xul_fastload", true);
    user_pref("extensions.logging.enabled", true);
    
  • Install debugging tools by running Maavis as above and use the Firefox Tools\add-ons menu item . You’ll want at least
    • Console2
    • DOMInspector
    • Venkman or Firebug
    • Chrome List
      See Setting up for these and more.
  • Some of the functionality is provided by a couple of C XPCOM components but these do not need to be built as the subversion repository contains prebuilt binary versions. TTS is used for speech and a modified version of Firefox process manger (nsIProcess) runs programs. However if you wish to work on them you will need to build them as part of a Mozilla build which includes various Microsoft dev kit. You should get the latest Firefox release source. Here is an example .mozconfig file to use:
    
    . $topsrcdir/browser/config/mozconfig
    mk_add_options MOZ_OBJDIR=../obj
    mk_add_options MOZ_MAKE_FLAGS=-j8
    ac_add_options --disable-tests
    ac_add_options --disable-debug
    ac_add_options --enable-optimize
    ac_add_options --enable-extensions=default,TTS,processmanager
    

    To speed up development by only building the components see James Boston and Humph’s notes on building C++ XPCOM components (copyCopy the Maavis extensions source folders from src\ into extensions\ in the Mozilla source tree and aftermake first-fclient.mk timeas buildusual. The built components are in $(objdir)/dist/bin/extensions. To speed up development by only building the components make in $(objdir)/extensions/$(objdir)/extensions/<extension>). toFor speeda thingsfull up).introduction see James Boston and Humph’s notes on building C++ XPCOM components. Also see James Boston’s notes on nsIProcess improvements .

Building the MaavisSkyper server for Skype integration and joystick button detection

Skype integration is provided by the MaavisSkypeServer which a fork of UNC’s Outfox. The skype code is in channel.py. If the server is not found an error is logged to the console and Skype integration is unavailable. Thus a quick way to disable this is to rename the server. Note having the joystick button code here is a big temporary hack.

By default, if platform\dist\MaavisSKypeServer.exe is found it will be run, otherwise the source code will be used. The source code will always be used if useSource = true in outfox.js. When using the source a debug window is shown, and this also appears if the exe is built using the console= option rather than windows= in setup.py.

  • Install Python 2.5.4 (2.6.* may be OK but is untested).
  • install the correct version of for python 2.5 from pywin (e.g. pywin32-214.win32-py2.5.exe)
  • For deployment you need to build with py2exe but it is also possible to use the outfox source code for debugging through changing the useSource flag in outfox.js.
  • Install Skype4Py (as administrator on Vista) e.g version 1.0.32. Disable the Skype Firefox add-on
  • Install “Pygame 1.9.1 for Python 2.5”;http://www.pygame.org/download.shtml
  • install ""SendKeys": http://www.rutherfurd.net/python/sendkeys
  • Build the server in the extension\platform folder with python setup.py py2exe.

To use the skype features you will need Install the supported version of Skype

Debugging tips

Occasionally code stubbornly just doesn’t work with no visibility on why. If that happens it’s best to strip it right back till it does work. Makes sure the jsconsole is working and you can print to it or use alert. Use the -jsconsole command line option as some early errors only appear there and not in Firebug. Also try the -console option especially for basic add-on config problems. If nothing seems to happen then check manifest and bindings are all correctly mapped as you don’t get errors if the files are not found in the chrome.

When changing the add-on doesn’t seem to work

Firefox caches the add-on configuration so if you change some files like extension\install.rdf you must delete the 3 extension.* files in the profile folder to force regeneration of the cache.

XBL

Debugging XBL can be a real pain. Errors in XBL don’t get reported and exceptions vanish. Therefore if you are having a problems with a method add an exception handler around the code with windows.alert() or logging. In fact I’m thinking of making it a style guideline to always have exception handlers round XBL methods (thoughts?). Another problem is that Venkman doesn’t seem to show method local const, so may need to revert to good old fashioned alerts/logs to debug.

Building the installer

Install Inno Setup to open and compile the installer\Maavis.iss file. The installer will be in the Output subfolder. You will need to setup the following files in addition to those checked out for the installer to compile.

  • The redistributed Firefox and Skype installers in the Installer folder. The latest version are available from fullmeasure.co.uk/maavis/installers. If the the filenames change then Maavis.iss must be updated. You must also copy new installers to fullmeasure.co.uk.
  • The redistributed Firefox plugins in the extension\plugins folder. Currently this is VLC and Flash. If they change they must be checked in to SVN.
  • The MavisSkypeServer distribution files in extension\platform\dist must be built as described above.

You can install on the development machine as well if you like as it uses the Maavis Firefox profile and so should not clash with the MaavisDevprofile as long as they point to their own copies of the extension. Note that Firefox and Skype are installed for all users, so are best not installed.

Making a release

  1. Check the version number was correctly increased as the last step of the previous release (see below)
  2. update the redistributed files if required – see above
  3. Build the installer by compiling Maavis.iss with inno setup – see notes above.
  4. Test the full install and Maavis on a clean machine. Take special care if redistributed installers or plugins changed.
  5. Copy the installer to Fullmeasure.co.uk/maavis (NB we need a better home, space is limited here)
  6. Update the wiki download page Download_and_Installation, at a minimum link to the new release.
  7. Create a tag in svn
  8. Update the version number in the Maavis.iss and install.rdf for the next release and check them into SVN

Other notes

  • Install the latest touch screen driver (see project downloads ) as the one supplied with the Iiyama monitor caused frequent touch screen failures.
  • I managed to develop on Ubuntu, running Windows in VirtualBox and sharing the extension code though a shared folder. Dual monitor setup allows Windows with touch screen on one monitor as described in this blog post.

Coding

Javascript, DOM and XUL etc etc

Mozilla’s MDC is the resource for all things for the platform. For javascript the Mozilla JS 1.5 guide is good and w3schools has good tutorials and references (and for DOM and other topics).
The XUL Tutorial is also a must read, especially the XBL Bindings section.

Coding style guidelines

Mozilla’s javascript style guidelines and Douglas Crockford’s are a great starting point and will be followed closely. JSLint is an excellent quality control tool