Programming Applets



next up previous contents
Next: Applet security Up: Caml Applets User guide Previous: Using Applets

Programming Applets

  There are two sides of applets API: what library functions are available to applets, and how to register applet functions (for the EMBED element) or how to extend the browser.

General Libraries

There are three general safe libraries that the applet developper may use:

These libraries do not need specific documentation. The author may refer to each library documentation, knowing that some functions are not available, as described in appendix A.

The Safemmm library

Safemmm is the API for the browser. It contains Web-related types and functions than an applet may call, and also the various hooks setup functions.

EMBED applets

A typical applet

Hints

deallocation: Caml Special Light has a garbage collector. Nevertheless, an applet may use global tables or other remanent data structures that should be cleanup up when the appled dies. A good way to implement the cleanup for your applet is to bind this cleanup to the Destroy event for the top widget given to you.

PGP authentication

Installing applets on a server

Once the applet has been compiled, it can be made available on the server as any other document. The only required modification to your installation is to configure your server so that is sends correct MIME type information. For an NCSA httpd server, you would add the following lines

# Suffix .cmo for bytecode files
AddType application/x-camlsl cmo
# Suffixes .asc and .pgp for PGP-signed files
AddEncoding pgp asc
AddEncoding pgp pgp
to the srm.conf file.



Francois Rouaix
Tue Nov 21 11:14:29 MET 1995