"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "OpenVerse/lib/Plugin.tcl" of archive OpenVerse-0.8-7.tar.gz:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) Tcl/Tk source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1 # OpenVerse Plugin Module
2 #
3 # changed
4 #
5 # This module contains all of the plugin related stuff.
6 # It will basically register all of your installed plugins.
7 #
8 # Module Name - Plugin Module
9 # Current Maintainter - Cruise <cruise@openverse.org>
10 # Sourced By - Main Module
11 #
12 # Copyright (C) 1999 David Gale <cruise@openverse.org>
13 # For more information visit http://OpenVerse.org/
14 #
15 # This program is free software; you can redistribute it and/or
16 # modify it under the terms of the GNU General Public License
17 # as published by the Free Software Foundation; either version 2
18 # of the License, or (at your option) any later version.
19 #
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
24 #
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
28 # USA.
29
30 # RegisterPlugin is used to register your plugin with the
31 # various available traps. There are two different types of traps.
32 # Some functions have both traps. Others have only one type..
33 # A (pre) trap will process the plugin BEFORE it processes it's own stuff
34 # or slightly after it begins (some functions need to set variables and
35 # this will normally be done before a plugin is called) A (post) trap will
36 # process the plugin AFTER it's done it's regular work.
37 #
38 # Functions with plugin support currently include....
39 #
40 # MoveTo (pre) Trapped when the user clicks on the screen to
41 # move.
42 # NewPerson (pre) Trapped when someone enters the room.
43 # PersonLeft (pre) Trapped when someone leaves the room.
44 # ChangeAvatar (post) Trapped when YOU change your avater.
45 # ChangeUserAvatar (post) Trapped when someone changes their avater.
46 #
47 # You will have access to all of the variables which are passed to the
48 # parent function. Your function should accomidate ALL of them.
49 # Your plugin should return 1 or 0. 1 will tell the parent function
50 # to continue processing. 0 will tell the parent function to exit
51 # it's normal processing.
52
53 proc RegisterPlugin {plugin trap function} {
54 global MV
55
56 lappend MV(plugin.traps.$trap) "$plugin"
57 set MV(plugin.traps.$trap.$plugin) "$function"
58 }
59
60 #
61 # Make a list of plugins. and register with
62 # available services.
63 #
64 foreach dir [List_Plugins] {
65 if ![file isdirectory "$dir"] {continue}
66 lappend MV(plugins) [file tail "$dir"]
67 source [file nativename "$dir/PlugInit.tcl"]
68 #TODO Report any errors here.
69 }
70
71
72 #
73 # These are our internal plugins. (plugin support for clickable things)
74 #
75
76 lappend MV(plugins) MV_DlWindows
77 RegisterPlugin MV_DlWindows MoveTo.Pre MV_DlWindows
78