module JavaApplet: sig .. end
Support for Java applets.
In order to produce a jar archive containing an applet, it is
necessary to link the application with the
-applet k
command-line switch, where
k designates the kind of applet
(AWT-, Swing-, or Graphics-based). An applet class will be generated,
with the name
pack.ocamljavaApplet where
pack can be set
using the
-java-package pack command-line switch.
When linking with the
-applet k command-line switch, the last
module to be linked has to be compatible with one of the module types
of the
JavaApplet module, the exact module type depending on the
value of
k. The following table gives the module types and
default implementations (modules compatibles with the module types,
with only no-op functions) for the different applet kinds.
The various kinds of applets.
| parameter to -applet |
module type |
default implementation |
| awt |
AWT |
Default_AWT |
| swing |
Swing |
Default_Swing |
| graphics |
Graphics |
Default_Graphics |
type parameter = {
}
The type of parameters, describing parameters accepted by an applet.
val parameter_info_of_list : parameter list -> parameter_info
Converts a list of parameters into a parameter info, preserving the
order of elements.
AWT-based applets
module type AWT = sig .. end
The module type for applets linked with -applet awt.
Swing-based applets
module type Swing = sig .. end
The module type for applets linked with -applet swing.
Graphics-based applets
type graphics_event = {
mouse_x : int;
(* X coordinate of the mouse. *)
mouse_y : int;
(* Y coordinate of the mouse. *)
button : bool;
(* true if a mouse button is pressed. *)
keypressed : bool;
(* true if a key has been pressed. *)
key : char;
(* the character for the key pressed. *)
}
Equivalent to Graphics.status, copied to avoid dependency.
module type Graphics = sig .. end
The module type for applets linked with -applet graphics.