%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Cameleon}
\label{cameleon}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}
The Cameleon tool is the glue between the other tools, to provide
an integrated development environment. Files are managed with CVS,
it includes various editors and a documentation browser.
Plug-ins can be loaded to add functionalities.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Start}

%%%%%%%%%%%%%%%%%%
\subsection{Launch command}
\label{cameleonlaunchcommand}
The following command launches Cameleon~:\\
{\tt cameleon {\bf[options]} [{\bf dir1}] ... [{\bf dirn}]}\\
You can use {\tt cameleon.opt} instead of {\tt cameleon} if the native code vers
ion is available on your system, but then you won't be able to use plug-ins.
The {\tt {\bf dir1}} \dots {\tt {\bf dirn}} arguments are a list of directories,
each one being called a {\em root directory}, usually the root directory of one 
of your project. If you don't specify any directory, the current working directory 
becomes the only root directory. 
Note that you must use CVS{\cite{cvs}} for the configuration management of your
files in order to be able to use Cameleon.

The available options are:
\begin{description}
\item[\op{}-v]
  Display the version number and exit.
\item[\op{-norep}]
  Use this option when the CVS repository is not available (for example
  when you are not connected to the network). You can then access your files
  through Cameleon but you cannot perfom any CVS action on it.
\item[\op{-com <command>}]
  Make Cameleon execute the given \op{<command>} at launch time.
  Commands are described in section \ref{cameleoncommands}.
  This option can be used several times to perform several commands,
  in the order they appear on the command line.
\item[\op{-expand\_dirs\_at\_start <true|false>}]
  Indicate whether the directory trees in the tree view of the main window
  must be expanded at start or not. The default value is the one in
  your {\tt \$HOME/.cameleon/gui} configuration file 
  (see section \ref{cameleonconfiguration}).
\item[\op{-check\_edited\_files\_delay nb}]
  When you edit files from Cameleon using Efuns or Xemacs,
  Cameleon check whether these files are still being edited,
  every \op{nb} miliseconds. You can change the delay here.
  The default value is the one in your {\tt \$HOME/.cameleon/gui} 
  configuration file (see section \ref{cameleonconfiguration}).
\end{description}

%%%%%%%%%%%%%%%%%%
\section{Main window}
\label{cameleonmainwindow}
The main window of Cameleon is shown on figure \ref{fig:mainwindow}.
The left part of this window shows directory trees, starting from the
root directories. The right part of the window displays the list of files
handled by CVS in the selected directory.
The toolbar below the menu can be configured.

\begin{figure}
\begin{center}
%HEVEA \begin{rawhtml} <img src="main_window.jpg">\end{rawhtml}
%BEGIN LATEX
%\includegraphics[width=\textwidth]{main_window.eps}
\epsfxsize=0.7\textwidth
\epsfbox{main_window.eps}
%END LATEX
\caption{Cameleon main window.}
\label{fig:mainwindow}
\end{center}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Commands}
\label{cameleoncommands}
Cameleon's functionalities are accessed through internal commands. We will
write a command in \com{red bold font}.
Since menus are totally customizable, we will refer to commands rather than
menu entries to indicate the command used to perform an action.

In addition to Cameleon internal commands, external commands can be used.
These commands are shell commands.

An internal command is a string, used as identificator to get the associated
callback. This string must not begin with the character {\tt \#} and must not
containt blanks, simple-quotes or double-quotes.

An external command is a string beginning with the character {\tt \#}. The
command which gets executed is the string after the first {\tt \#}. In these
commands, you can use some expressions to refer to the current state of Cameleon~:
\begin{itemize}
\item {\tt \%f} refers to the first selected file, or to the empty string if no
file is selected,
\item {\tt \%F} refers to the list of selected files, separated with a blank space,
or to the empty string if no file is selected,
\item {\tt \%d} refers to the selected directory, or to the empty string if
no directory is selected,
\item {\tt \%s} refers to a string asked to the user. If more than one {\tt \%s}
 appear in the command, all strings are asked to the user in a single window,
in the order they appear in the command, i.e. the value for the first {\tt \%s}
in the command will be entered in the first field of the window.
\end{itemize}

All file and directory names are ``quoted'', with the {\tt Filename.quote} function
of the OCaml standard library.

Commands can be launched through menu entries, buttons in the toolbar, or keyboard
shortcuts.

Some internal commands are defined in Cameleon but more commands can be made available
by loading plug-ins (see \ref{cameleonplugins}).

At last, internal commands can take parameters, the same way as shell commands
in a shell, i.e. the arguments are separated by blanks and quotes can be
used when an argument contains one or more blanks.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Configuration}
\label{cameleonconfiguration}
The configuration of Cameleon is performed through the \com{config} command which
opens the configuration window.

%%%%%%%%%%%%%%%%%%%
\subsection{File types}
\label{cameleonfiletypesconf}

A file type is defined by:
\begin{itemize}
\item a regular expression (pattern), used to associate the file type to a file name,
\item a description of the file type~: This is the string displayed in the
        {\em file type} column of the main window (see \ref{cameleonmainwindow}),
\item  a color name~: This is the color used to display a file in the main window
(see \ref{cameleonmainwindow}); the color name can be given with a name like ``Red''
or with a RGB code like ``\#O4F5D6'',
\item a ``Binary'' flag to indicate whether the files of this type are binary files or
text files; this is useful for some CVS commands,
\item an editor~: Cameleon provides various editors and more can be made available
    by plug-ins (see \ref{cameleoneditors}). The editor associated to a file type
    is used to edit the selected files when the \com{edit} command is triggered,
\item a list of templates~: a template is a file. The list of templates is used
    when adding a new file from Cameleon, with the \com{new\_file} command.
    The user must then choose the type of the file he wants to create, among the
    list of defined file types. The templates associated to the file type he choses
    are copied in the new file, with the {\tt cat} UNIX command.
\end{itemize}

The file types can be defined in the ``File types'' tab of the configuration window,
as shown in figure \ref{fig:filetypesconf}.

\begin{figure}
\begin{center}
%HEVEA \begin{rawhtml} <img src="file_types.jpg">\end{rawhtml}
%BEGIN LATEX
%\includegraphics[width=\textwidth]{file_types.eps}
\epsfxsize=0.7\textwidth
\epsfbox{file_types.eps}
%END LATEX
\caption{Edition of file types.}
\label{fig:filetypesconf}
\end{center}
\end{figure}

When looking for the type of a file according to its name, Cameleon tries each regular expression
in the order they appear in the list, and stops with the first regular expression matching
the filename. \\
Note~: The given regular expressions are used to match against the complete name of a file,
       starting from the root node name.

%%%%%%%%%%%%%%%%%%%
\subsection{Documentation}
\label{cameleondocconf}

The available documentation is defined as a list of doc-files (see \ref{cameleonavaildoc}).
This list can be edited in the ``Documentation files'' tab of the configuration window.

%%%%%%%%%%%%%%%%%%%%
\subsection{Toolbar}
\label{cameleontoolbarconf}

You can customize the toolbar in the main window (see \ref{cameleonmainwindow}),
by adding your own buttons, associated to the commands of your choice
(internal or external, see \ref{cameleoncommands}). This is done through the
``Custom toolbar'' tab of the configuration window.

Each button of the toolbar is defined by~:
\begin{itemize}
\item an icon, which must be a pixmap file (usually {\tt .xpm}),
\item a label, which appears as a tooltip when the mouse cursor is on the button,
\item a command (internal or external, see \ref{cameleoncommands}).
\end{itemize}

Note: Associating an internal command which is not available to a button
will disable the button.

%%%%%%%%%%%%%%%%%%%%
\subsection{Menus}
\label{cameleonmenusconf}

Menus and menu entries can be configured, through the
``Menus'' tab of the configuration window, shown on figure \ref{fig:menusconf}.
\begin{figure}
\begin{center}
%HEVEA \begin{rawhtml} <img src="menus.jpg">\end{rawhtml}
%BEGIN LATEX
%\includegraphics[width=\textwidth]{menus.eps}
\epsfxsize=0.7\textwidth
\epsfbox{menus.eps}
%END LATEX
\caption{Edition of menus.}
\label{fig:menusconf}
\end{center}
\end{figure}

You can create menus, menu commands and separators.
Menu commands are defined by a label (which will appear in the menu)
and a command (internal of external, see \ref{cameleoncommands}). Activating
a menu command launches the associated internal of external command.

Note: Associating an internal command which is not available to a menu command
will disable the menu command.

While editing menus, you will have to mark one of them as the {\tt Doc} menu,
used to dynamically add entries, depending on the available doc-files
 (see \ref{cameleonavaildoc}).

%%%%%%%%%%%%%%%%%%%%
\subsection{Colors and fonts}
\label{cameleoncolorsfontsconf}
The ``Colors and fonts'' tab lets you choose the colors and fonts
used in
the documentation browser (see section \ref{docbrowser}), 
the modules view (see section \ref{cameleonmodulesview})
and the background command execution window.

%%%%%%%%%%%%%%%%%%%%
\subsection{Keyboard shortcuts}
\label{cameleonshortcutsconf}
The keyboard shortcuts can be configured to bind a key combination
to a command (internal or external, see \ref{cameleoncommands}).
You can also set the key bindings of the documentation browser
(see \ref{docbrowser}).

The edition of key bindings is done in the ``Key bindings'' tab
of the configuration window.


%%%%%%%%%%%%%%%%%%%%
\subsection{Plug-ins}
\label{cameleonpluginsconf}

With the bytecode executable {\tt cameleon}, you can load plug-ins,
to define new commands, new editors, new views, ...

The selected plug-ins are loaded at launch time.

There are two lists of available plug-ins: the shared plug-ins
(in the shared plug-ins directory, see \ref{camconfigutil})
and the personal plug-ins, in your {\tt \$HOME/.cameleon/plugins}
directory.

In the ``Plug-ins'' tab of the configuration window you can 
select which plug-ins you want to load, among the list
of available plug-ins.

The selected plug-ins are then loaded when you close the configuration window
with the ``Ok'' button. Plug-ins already loaded are not loaded again.

%%%%%%%%%%%%%%%%%%%%
\subsection{Custom configuration tabs}
\label{cameleoncustomconftabs}

The configuration window may contain other tabs. Indeed, a plug-in
can add a configuration tab when it offers some configuration
possibilities. See \ref{cameleonplugins} for details.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{CVS management}
\label{cameleoncvs}

CVS actions can be performed from the main window
with the following internal commands~:
\com{add\_dir},
\com{update\_dir},
\com{commit\_dir},
\com{tag\_dir},
\com{add\_file},
\com{add\_binary\_file},
\com{commit\_files},
\com{tag\_files},
\com{tags\_of\_file},
\com{remove\_files},
\com{last\_diff},
\com{diff\_with},
\com{diff\_between},
\com{resolve\_conflicts}.

The contextual menu which appears when you click with the third mouse button on a file
of the {\em files view} (see section \ref{cameleonviews}) or a directory gives access 
to these commands, as does the default \menu{CVS} menu.

Note: You can use the {\tt\$HOME/.ocamlcvsrc} file to configure the CVS commands
used in background (see chapter \ref{ocamlcvs}).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Editors}
\label{cameleoneditors}

Editing a file is made with the \com{edit} command, or with the contextual
menu which appears when you click with the third mouse button on a file.
A file can be edited by various editors. The used editor depends on the type of 
each file.
See \ref{cameleonfiletypesconf} about associating an editor to a file type.\\
Currently, six editors are supported by Cameleon~: Efuns\cite{efuns}, 
Emacs\cite{emacs}, XEmacs\cite{xemacs}, DBForge, Report, Zoggy.
A custom editor can also be associated to each file type to use another editor.

%%%%%%%%%%%%%%%%%%
\subsection{Efuns}
In order to use Efuns as editor, {\tt efuns} must be running as a server on the 
same machine.
Cameleon communicates with the {\tt efuns} process through sockets. When a file 
is edited, Cameleon asks to the {\tt efuns} process to open this file. 
Cameleon can also ask Efuns if a file is saved, for example when a file is about 
to be commited. If the file is not saved, the user is asked whether he wants to 
save the file before committing or not.

%%%%%%%%%%%%%%%%%%
\subsection{Emacs and XEmacs}
Emacs (respectively XEmacs) can be used as editor if an emacs (resp. xemacs) ser
ver is running on the same machine. Cameleon communicates with Emacs (resp. XEmacs) 
through the {\tt emacsclient} (resp. {\tt gnuclient}) command.
Cameleon can only ask to Emacs to open a file, so the user must take care himself 
about saving files before commiting, etc ... On the other hand, Cameleon can ask 
XEmacs if a file is being edited, if a file changed, ... 

%%%%%%%%%%%%%%%%%%
\subsection{DBForge}
The DBForge editor can be used to edit DBForge schema descriptions. 
See chapter \ref{dbforge} for details about these files. When a schema file is 
edited with DBForge, a window appears with the same graphical interface as the 
stand-alone DBForge tool. Closing this window closes the file. When using the 
DBForge editor, Cameleon can ask the user to save the edited file 
before committing, the same way as with Efuns.

%%%%%%%%%%%%%%%%%%
\subsection{Report}
The Report editor can be used to edit Report XML document descriptions. 
See chapter \ref{report} for details. The Report editor in Cameleon works the 
same way as the DBforge editor (see above).

%%%%%%%%%%%%%%%%%%
\subsection{Zoggy}
The Zoggy editor can be used to edit Zoggy graphical interface descriptions. See
 chapter \ref{zoggy} for details. The Zoggy editor in Cameleon works the same way 
as the DBforge editor (see above).

%%%%%%%%%%%%%%%%%%
\subsection{Custom editors}
If none of the predefined editors fit the user's needs, a custom editor can be 
defined and associated to a file type. Custom editors are defined by plug-ins
 (see \ref{cameleonplugins}). 
This is the case for the Omom editor (see chapter \ref{omom}).


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The directory tree}
\label{cameleondirtree}
The directory tree shows the directories handled by CVS. You can
perform CVS actions on the selected directory using the right commands
(see section \ref{cameleoncvs}).

To choose whether the trees are expanded at start or not, you
can use the \op{expand\_dirs\_at\_start} command line option
(see section \ref{cameleonlaunchcommand}).


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The views}
\label{cameleonviews}
The right pane of the main window contains a notebook with
different views of the selected directory. Two views are
defined by default but more views can be added by plug-ins
(see section \ref{cameleonplugins}).

%%%%%%%%%%%%%%%%%%%%
\subsection{The files view}
\label{cameleonfilesview}
The files view shows the files handled by CVS, in the selected directory.
In this view you can perform CVS actions like commit, add file, ...
The files are displayed according to their associated file type
(see section \ref{cameleonfiletypesconf}).

%%%%%%%%%%%%%%%%%%%%
\subsection{The modules view}
\label{cameleonmodulesview}
The modules view show the OCaml modules in the selected directory.
To do so, it looks for a file {\tt dump.odoc} in the selected
directory. This file must be an OCamldoc dump file. It should
contain information on the modules in the selected directory
but you can put information on the modules you want in that file.

If the file does not exist, Cameleon try a {\tt make dump.odoc}
to create the file. If it does not work, and there is not {\tt dump.odoc}
file available, nothing is displayed.

When information is found, you can see the modules and classes trees
on the left of the view, and selecting a module, module type, class
or class type shows its elements on the right of the view. You
can click with the right button of an element in the tree or the
list to create a menu letting you edit the corresponding file
at the line corresponding to the element definition.
You can choose to open the implementation or the inferface file,
depending of whether the documentation was created from the 
implementation file or the interface file, or both.

You can change the colors in this view in the configuration
window (see section \ref{cameleoncolorsfontsconf}).

The ``Refresh'' button launch the {\tt make dump.odoc} command
and read the {\tt dump.odoc} file to update the view.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The documentation browser}
\label{docbrowser}
The documentation which can be accessed from Cameleon consist in information
on OCaml modules. The user can choose these modules. 
Let's see how to choose these modules and browse their documentation.

%%%%%%%%%%%%%%%%%%
\section{Available documentation}
\label{cameleonavaildoc}
The available documentation is defined by the user (see \ref{cameleondocconf})
as a list of {\em doc-files}. 
A doc-file contains information on toplevel modules, and must have been produced by
the {\tt -dump} option of {\tt ocamldoc} (see \cite{ocamldoc}).

Each specified doc-file is loaded when Cameleon is launched. 
If the doc-file does not exist, a warning message points this out.
All toplevel modules in the doc-files are sorted and the {\tt Doc} menu is built from 
these modules (see \ref{cameleonmenusconf}). 

In order to avoid too big menus, menus are cascaded. 
When a module is chosen in the {\tt Doc} menu, its documentation is displayed in a
 documentation browser, described in \ref{docbrowser}.

At last, a label and an action can be associated to each doc-file (see \ref{cameleondocconf}).
For each of these pairs of label and action, an entry is added to the {\tt Doc} menu,
with the given label. When the menu entry is activated, the given action is triggered. This 
action usually updates the corresponding doc-file. When the action is over, the {\tt Doc}
menu is updated according to the doc-file modifications.


%%%%%%%%%%%%%%%%%%
\section{Accessing the documentation}
\label{cameleonaccessingdoc}

You can access the documentation on a module by selecting it in the
{\tt Doc} menu. It opens the documentation browser on this module.

The {\tt Doc} menu also contains two entries, {\tt Exact search} and {\tt Regexp search}
which allow the user to search for {\em elements} (as defined in \cite{ocamldoc})
 by name, with the exact name or a regular expression. 
The search is performed on complete names, so you will find the {\tt iter} function
of the {\tt List} module by using, for example, the {\tt Exact search} command
with the {\tt ``List.iter''} string.

If only one element matched the search, the documentation browser is open
on this element, else a window appears showing all the results, and selecting
one opens the documentation browser on this element.

The \com{display\_modules\_box} command can be used to show the list
of available toplevel modules (it is created at launch time, but you
can close it). In this window, called the {\em doc modules box}, 
you can double-click on a module to
browse its documentation. You can walk through the list with the up
and down arrows or use the 'A' .. 'Z' keys to go directly to the modules
beginning with the letter corresponding to the key you hit. The
``Return'' key opens the selected module.

You can also use the top field to enter a string and
perform an exact search on this string with the button below.

This field is a combo box, where you can add predefined strings.
These predefined strings are bookmarks: you select a bookmark
and then click the ``Exact Search'' button to go to the element
(or the list of elements mathcing the search).
To add a bookmark, use the \com{add\_bookmark} command in the documentation
browser.

%%%%%%%%%%%%%%%%%%
\section{Browsing the documentation}
\label{cameleonbrowsingdoc}

The documentation browser is a window showing the interface
of a module or a class, with the comments of the source.
It uses the information read from OCamldoc dump files.

You can click on some text to follow the link, for example
you can click on a type name to go to its definition if it
is available, like in a HTML document.

The following actions can be performed in the browser window:
\begin{description}
\item[\op{next\_element}] Go to the next element or link in the window,
  from the current position.
\item[\op{previous\_element}] Go to the previous element or link in the window,
  from the current position.
\item[\op{follow\_link}] Follow the link on which we are.
\item[\op{follow\_link\_in\_new}] Open a new browser window to follow the link
  on which we are.
\item[\op{close}] Close the browser window.
\item[\op{search}] Search for a string in the window. You type the string
  in the field at the bottom of the window. Can be called several times
  to go to the next elements matchting the searched string.
\item[\op{back\_search}] Same as \op{search} but search backward instead of
  forward.
\item[\op{back}] Go back to the previous page (like in a web browser).
\item[\op{add\_bookmark}] Add the element which was used to open
  the current page to the list of predefined strings in the search
  field of the {\em doc modules box}.
\item[\op{home}] Go to the beginning of the page.
\item[\op{end}] Go to the end of the page.
\item[\op{menu}] Pop up a contextual menu.
\end{description}

These action are bound to keys, and you can edit these bindings
in the configuration window (see section \ref{cameleonshortcutsconf}).

The contextual menu, which appears with the \com{menu} command or
a click with the right button on an element, allow you to browse
the follow a link in a new window, or open the file from which 
the documentation was created, by using the associated editor.
The file is open as the right line where the element is defined.

Colors and fonts of the browser can be changed in the configuration
window (see section \ref{cameleoncolorsfontsconf}).

%%%%%%%%%%%%%%%%%%
\section{The standalone browser}
\label{cameleonstandalonebrowser}
The {\tt docbrowser} command (or {\tt docbrowser.opt} if the native code version
is installed) is a standalone documentation browser that you can
launch without using Cameleon. It takes as arguments the OCamldoc dump files
you want to browse. The colors, fonts and shortcuts are the ones defined
in Cameleon (same configuration file).


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The {\tt cam-config} utility}
\label{camconfigutil}

The {\tt cam-config} utility can be (and must be) used to get
information on the installation of Cameleon, in
the Makefiles of your own Cameleon plug-ins or your tools
using the Cameleon tools and libraries.

It supports the following options:
\begin{description}
\item[\op{-l}] Print the directory of the Cameleon libraries.
\item[\op{-b}] Print the directory of the Cameleon executables.
\item[\op{-m}] Print the directory of the Cameleon man pages.
\item[\op{-t}] Print the directory of the Cameleon templates.
\item[\op{-p}] Print the directory of the Cameleon plugins.
\item[\op{-q}] Print the directory of the Cameleon pixmaps.
\item[\op{-v}] Print the version of Cameleon.
\end{description}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Plug-ins}
\label{cameleonplugins}
Cameleon (bytecode version) can load plug-ins in the form
of OCaml object-files ({\tt .cmo} or {\tt .cma} files).

Plug-ins can add:
\begin{itemize}
\item new internal commands,
\item new editors (custom editors),
\item new configuration boxes (when a plug-in can be configured,
  its configuration box can be added to the tabs of the configuration
  window),
\item new views for the selected directory,
\item embedded applications.
\end{itemize}

Some default plug-ins are available and are detailed below.
To develop new plug-ins, you must use the {\tt Cam\_plug}
module of Cameleon, as explained in subsection \ref{developingplugins}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Shared/Personal plug-ins}
There are two kinds of plug-ins: shared and personal.
Shared plug-ins are available for everyone and are installed
in the Cameleon shared plug-ins directory. This directory
is printed by the following command:\\
{\tt cam-config -p}\\
Personal plug-ins are in the user's {\tt \$HOME/.cameleon/plugins}
directory. 

Here are the default installed shared plug-ins.
Do not forget that you can choose which plug-ins you want to
use (see section \ref{cameleonpluginsconf}).

%%%%%%%%%%%%
\subsection{The {\tt utils} plug-in}
\label{pluginutils}
This is a simple plug-in defining commands.
%HEVEA \htmlinput{pluginutils.html}
%BEGIN LATEX
\input{pluginutils.tex}
%END LATEX

%%%%%%%%%%%%
\subsection{The {\tt editors} plug-in}
\label{plugineditors}
This plug-in define additionnal editors for some file types.
%HEVEA \htmlinput{plugineditors.html}
%BEGIN LATEX
\input{plugineditors.tex}
%END LATEX

%%%%%%%%%%%%
\subsection{The {\tt make} plug-in}
\label{pluginmake}
This plug-in defines the {\tt make} internal command which
launches the {\tt make} utility on the given arguments, in
the selected directory.
%HEVEA \htmlinput{pluginmake.html}
%BEGIN LATEX
\input{pluginmake.tex}
%END LATEX

%%%%%%%%%%%%
\subsection{The {\tt chat} plug-in}
\label{pluginchat}
This plug-in defines an embedded chat application, launched with the
{\tt chat} command.
%HEVEA \htmlinput{pluginchat.html}
%BEGIN LATEX
\input{pluginchat.tex}
%END LATEX

%%%%%%%%%%%%
\subsection{The {\tt omom} plug-in}
\label{pluginomom}
This plug-in adds an editor to edit OCamlmake-o-matic files.
%HEVEA \htmlinput{pluginomom.html}
%BEGIN LATEX
\input{pluginomom.tex}
%END LATEX

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Developing your own plug-ins}
\label{developingplugins}
To develop a Cameleon plug-in, you will have to use the
{\tt Cam\_Plug} module, installed with Cameleon. This module
defines functions to add editors, embedded applications, 
internal commands. Some functions are used to retrieve information
on Cameleon current state (selected files, ...), and some
utilities functions are also provided.

%HEVEA \subsection{The Cam\_plug module}\begin{rawhtml}Here is the interface of the <a href="Cam_plug.html">Cam_plug module</a>.\end{rawhtml}
%BEGIN LATEX
\input{cam_plug.tex}
%END LATEX


%%%%%%%%%%%%%%
\subsection{Example}
Here is the code of a simple plug-in:

%HEVEA \htmlinput{plugin_example.html}
%HEVEA \begin{rawhtml}<br>\end{rawhtml}
%BEGIN LATEX
\verbatiminput{../plugins/utils.ml}
%END LATEX

You can compile it with the following command:\\
{\tt ocamlc -c -I +cameleon plugin.ml}\\
Then place the resulting {\tt .cmo} file in the shared plug-ins directory
or your personal plug-ins directory. Cameleon will let you choose this 
new plug-in to load, in the ``Plug-ins'' tab of the configuration window
(see section \ref{cameleonpluginsconf}).
If you develop such plug-ins and want to distribute them, please
e-mail {\tt maxence.guesdon@inria.fr}, so your plug-ins can be referenced
on a Cameleon plug-ins page.
