********************************
THE PLUG-IN SYSTEM DOCUMENTATION
********************************

Incomplete, but working on it...

INDEX
=====

1. The Plug-in system
 1.1 About it
 1.2 How it works
 1.3 How to create a new plug-in
 1.4 A plug-in example
 1.5 Future
2. AMSN
 2.1 About AMSN
 2.2 Connecting to the server
 2.3 Session
 2.4 Chat and Messaging
 2.5 Preferences
 2.6 Remote control
A. Annexes
 A1.- protocol.tcl procedure specification
 A2.- gui.tcl procedure specification
 A3.- amsn[.tcl] procedure specification
 

1. The Plug-in system
=====================

1.1 About it
------------

After AMSN 0.80 we thought that we needed to work on a system so amsn could be extended and new features added without having to change the main amsn code, which usually results on new bugs, problems, and difficult to read it.

1.2 How it works
----------------

The idea of the plugins system is to keep all the plugin code out of the main amsn script files (protocol.tcl, gui.tcl, ...), so you can add, change, improve or remove plugins without breaking amsn. 

Every plugin must have one (or more) .tcl files located in the msn/plugins or in ~/.amsn/plugins directory. Amsn will parse this files on init. These files shouldn't have any runnable scripts except the code to register the plugin information, and one or more namespaces where the plugin code will actually be.

When a plugin "registers", it tells amsn what its name is, its version, a small description, what plugin procedure must be called for the plugin setup, and what "events" it will be listening for.

The plugin system is an event driven system. That means, the plug-in tells amsn what events he wishes to be notified of, and which procedure must be called when each event happens. Optionally, you can specify a priority, so some plugins are executed before (or after) others.

When an event happens, the procedure ::plugins::postEvent is called from inside the amsn code. This procedure will get the list of plugins that are listening for that event, and call the given procedures in order.


1.3 How to create a new plug-in
-------------------------------
http://amsn.sourceforge.net/wiki/tiki-index.php?page=Plugin+developer+Guide
1.4 A plug-in example
---------------------
http://amsn.sourceforge.net/wiki/tiki-index.php?page=Plugin+developer+Guide
(3 plugins example at the files in the bottom)


2. AMSN
=======


A. Annexes
==========

See the .tcl files, there you can find comments at the header or every procedure.