xchm for Debian
---------------

  Desktop / MIME integration from Loic Minier <lool@dooz.org>

  This is quite a lot of things that should go in xchm:
  - GNOME <= 2.4 integration (MIME entries, application registry entries etc.)
    not tested
  - freedesktop.org integration (for GNOME 2.6 and maybe KDE)

  This is are MIME support enabling files for xCHM targeting better GNOME/KDE
  integration.

  This is only tested it with GNOME, it might require some additional work to
  integrate with KDE correctly. If one want to check for support, here are the
  commands used:
  - run-mailcap file.chm: will look for the MIME type for .chm files in
    /etc/mime.types or ~/.mime.types, and open the application bound to this
    type in /etc/mailcap with the syntax described in /etc/mailcap
  - gnome-open display.chm: will look for the MIME type for .chm files in the
    GNOME MIME types database, or in the freedesktop.org shared MIME information
    database, and will open the GNOME application found in the GNOME application
    database or in the freedesktop.org shared application database associated to
    this type.

  It seems two MIME support schemes are being used in GNOME right now,
  - the old one, consisting of .keys and .applications files in
    /usr/share/{mime-info,application-registry} respectively and .mime in
    /usr/lib/mime/packages seems half broken (.applications aren't picked up
    any more). dh_installmime is used to install .mime file.
  - the new one, "standardized" by freedesktop.org, consisting of .desktop and
    .xml files (in /usr/share/{applications,mime/packages/} respectively).

  Some notes concerning the MIME support enabling files for xCHM:
  - the .desktop Categories: are Application, Viewer, and graphics as found on
    the web, in /usr/share/applications, and in grep '<Name>'
    /etc/gnome-vfs-2.0/vfolders/applications-all-users.vfolder-info,
  - looking in Graphics directory, It is seen that the .desktop Name: of some
    entries isn't related to the name of the program, but to what they do. It
    is unclear what the GNOME HID guidelines are suggesting. This program is
    explicitly targeting CHM files, and the users will probably recall they
    have installed xCHM to view CHM files anyway.
  - most viewers use the French translation "Visionneur" for "viewer", which
    isn't a French word. Xchm is using "Visionneuse".
  - the xchm.keys, xchm.applications, and xchm.mime files have been guessed from
    a lot of sources. There is no exhaustive reference for them especially for
    the priority of keys like default_action_type, open, view,
    short_list_application_ids_for_novice_user_level, and also for the category
    key.

  TODO.Debian:
  - Regarding MIME integration:
     - Submit new patterns for the /etc/gnome-vfs-mime-magic file update, it
       seems we can do some filename based pattern matching meanwhile
  - GNOME support: gconf, gvfs, DnD, recent-files, session mgt,
    (see <http://primates.ximian.com/~federico/news-2004-05.html#25>)

  Other things to do in xCHM:
  - Support for opening multiple files

  Other things to do for the CHM file format:
  - Register a real MIME type - at IANA:
    Some work on MIME type research for the CHM files is done, and unfortunately
    nobody bothered to register it. "application/vnd.ms-chm" is submitted to the
    IANA on july the 11th. It should be ok to use the application/x-chm type
    meanwhile: */x-*  is meant for local extensions.
  - register file hinting in the appropriate databases:
    It is found that this sequence of bytes is the appropriate one for detecting
    CHM files (from /usr/share/misc/file/magic): 0 string
    ITSF\003\000\000\000\x60\000\000\000\001\000\000\000

    CHM files support should be integrated in:
    - /etc/gnome-vfs-mime-magic
    - /usr/share/misc/file/magic.mime (with the appropriate MIME type)
    - the freedesktop.org equivalent of the magic file
  - register the MIME type in /etc/mime.types:
     This is sent to mime-support@packages.debian.org on Tue, 22 Jun 2004
     15:46:39 +0200. No new mime-support package has been published since.

  -- Kartik Mistry <kartik@debian.org>  Mon, 16 Feb 2009 22:26:11 +0530
