doc/TCL-HOWTO.dox

Sat, 28 Jul 2007 08:47:44 +0000

author
William Ehlhardt <williamehlhardt@gmail.com>
date
Sat, 28 Jul 2007 08:47:44 +0000
branch
soc.2007.certmgr
changeset 18907
07343a83e67c
parent 16257
66f737e6b718
child 24595
8b5abc3f53a9
permissions
-rw-r--r--

- Delegate all button enabling/disabling in tls_peers_mgmt to its "is
anything selected in the window?" function.

10409
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
1 /** @page tcl-howto Tcl Scripting HOWTO
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
2
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
3 @section Intoduction
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
4
10597
41d2db9fefd5 [gaim-migrate @ 12012]
Ethan Blanton <elb@pidgin.im>
parents: 10410
diff changeset
5 NOTA BENE: This documentation is badly out of date for 2.x.
41d2db9fefd5 [gaim-migrate @ 12012]
Ethan Blanton <elb@pidgin.im>
parents: 10410
diff changeset
6
10409
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
7 The Gaim Tcl interface provides a Tcl API for many useful gaim
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
8 functions. Like the perl API, the Tcl API does not provide
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
9 access to every corner of gaim exposed by the @e C interface. It does,
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
10 however, provide a very powerful interface to many of Gaim's functions
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
11 through a simple to learn and extend scripting language.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
12
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
13 If you are not familiar with Tcl, you will probably find it somewhat
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
14 different from what you are used to. Despite being somewhat unique
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
15 (more akin to shell programming than other traditional scripting
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
16 languages such as @e perl or @e python), it is simple to learn for
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
17 beginners and experienced programmers alike. There are numerous books
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
18 on the subject; we will not discuss it any further here.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
19
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
20 @section start Getting Started
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
21
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
22 The only requirement placed on a Gaim Tcl script by Gaim is the
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
23 existence of a procedure called @c plugin_init. This procedure has
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
24 some limitations placed upon it; it will be parsed and evaluated before
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
25 the rest of the Tcl script, so it cannot reference any other variables
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
26 or procedures declared in the script. In practice this is not a
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
27 problem, as the only thing this procedure should do is return a simple
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
28 list containing five items: the @b name of the script, its @b version
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
29 number, a @b summary (just a few words) of its function, a short (longer
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
30 than the summary, but no more than a couple of sentences if possible)
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
31 @b description, the @b author, and a @b URL to web page. For example:
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
32
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
33 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
34 proc plugin_init { } {
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
35 return [ list "Example Plugin" \
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
36 "1.0" \
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
37 "Example plugin registration" \
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
38 "Example of how to register a plugin for the Tcl HOWTO" \
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
39 "Ethan Blanton <eblanton@cs.purdue.edu>" \
16257
66f737e6b718 More renaming.
Richard Laager <rlaager@pidgin.im>
parents: 10597
diff changeset
40 "http://pidgin.im/" ]
10409
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
41 }
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
42 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
43
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
44 The rest of the script will generally be registration to recieve
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
45 notification of various Gaim signals (more about this below) and
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
46 definitions of procedures to be executed when those signals occur.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
47
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
48 @section details Interpreter Details
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
49
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
50 Gaim initializes and drives the Tcl event loop (similar to Tk),
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
51 meaning that commands like @c fileevent and @c after are available and
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
52 do not require @c vwait etc. The @c vwait actually seems to be somewhat
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
53 broken due to a bug somewhere in the Tcl/Glib event loop glue, and it
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
54 should not be used for now.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
55
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
56 The gaim-specific functions are provided in a statically-linked
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
57 package called @c gaim; this means that if you spawn a child
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
58 interpreter and wish to use the gaim-specific functions, you will need
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
59 to execute <tt>load {} gaim</tt> in that interpreter.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
60
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
61 @section internals Gaim Internal Procedures and Variables
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
62
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
63 All of the information provided for your use by Gaim will be in the @c
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
64 ::gaim namespace. This means that in order to access it you will either
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
65 have to import the gaim namespace (e.g. via the command <tt>namespace
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
66 import gaim::*</tt>) or reference it explicitly. The following
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
67 descriptions will reference it explicitly for clarity.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
68
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
69 @li Variables
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
70
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
71 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
72 gaim::version
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
73 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
74
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
75 This contains the version of the gaim process which loaded the
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
76 script.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
77
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
78 @li Commands
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
79
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
80 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
81 gaim::account alias account
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
82 gaim::account connect account
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
83 gaim::account connection account
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
84 gaim::account disconnect account
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
85 gaim::account find username protocol
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
86 gaim::account handle
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
87 gaim::account isconnected account
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
88 gaim::account list ?option?
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
89 gaim::account protocol account
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
90 gaim::account username account
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
91 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
92
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
93 The @c gaim::account command consists of a set of subcommands
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
94 pertaining to gaim accounts.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
95
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
96 @c alias returns the alias for the account @c account. If there is no
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
97 alias for the given account, it returns the empty string.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
98
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
99 The subcommand @c connect connects the named account if it is not
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
100 connected, and does nothing if it is. In either case, it returns
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
101 the @c gc for the account.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
102
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
103 @c connection returns the @c gc of the given account if it is connected,
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
104 or 0 if it is not. This @c gc is the gc used by gaim::connection and
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
105 other functions.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
106
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
107 @c disconnect disconnects the given @c account if it is connected, or
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
108 does nothing if it is.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
109
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
110 @c find finds an account by its @c username and @c protocol (as returned by
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
111 <tt>gaim::account username</tt> and <tt>gaim::account protocol</tt>) and
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
112 returns the account if found, or 0 otherwise.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
113
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
114 @c handle returns the instance handle required to connect to account
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
115 signals. (See <tt>gaim::signal connect</tt>).
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
116
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
117 The @c isconnected query returns true if the given account is
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
118 connected and false otherwise.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
119
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
120 The @c list subcommand returns a list of all of the accounts known to
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
121 Gaim. The elements of this lists are accounts appropriate for the
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
122 @c account argument of the other subcommands. The @c -all option
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
123 (default) returns all accounts, while the @c -online option returns
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
124 only those accounts which are online.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
125
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
126 The @c protocol subcommand returns the protocol ID (e.g. "prpl-msn")
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
127 for the given account.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
128
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
129 The @c username subcommand returns the username for the account
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
130 @c account.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
131
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
132 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
133 gaim::buddy alias buddy
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
134 gaim::buddy handle
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
135 gaim::buddy info ( buddy | account username )
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
136 gaim::buddy list
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
137 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
138
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
139 @c gaim::buddy is a set of commands for retrieving information about
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
140 buddies and manipulating the buddy list. For the purposes of Tcl,
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
141 a "buddy" is currently a list of several elements, the first of
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
142 which being the type. The currently recognized types are "group",
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
143 "buddy", and "chat". A group node looks like:
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
144 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
145 { group name { buddies } }
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
146 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
147 A buddy node is:
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
148 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
149 { buddy name account }
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
150 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
151 And a chat node is:
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
152 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
153 { chat alias account }
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
154 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
155
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
156 The @c alias subcommand returns the alias for the given buddy if it
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
157 exists, or the empty string if it does not.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
158
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
159 @c handle returns the blist handle for the purposes of connecting
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
160 signals to buddy list events. (See <tt>gaim::signal connect</tt>).
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
161
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
162 @c info causes gaim to display the info dialog for the given buddy.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
163 Since it is possible to request user info for a buddy not in your
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
164 buddy list, you may also specify a buddy by his or her username and
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
165 the account through which you wish to retrieve info.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
166
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
167 @c list returns a list of @c group structures, filled out with buddies
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
168 and chats as described above.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
169
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
170 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
171 gaim::connection account gc
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
172 gaim::connection displayname gc
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
173 gaim::connection handle
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
174 gaim::connection list
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
175 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
176
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
177 @c gaim::connection is a collection of subcommands pertaining to
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
178 account connections.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
179
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
180 @c account returns the Gaim account associated with @c gc. This
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
181 account is the same account used by @c gaim::account and other
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
182 commands.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
183
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
184 @c displayname returns the display name (duh) of @c gc as reported by
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
185 <tt>gaim_connection_get_display_name(gc)</tt>.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
186
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
187 @c handle returns the gaim connections instance handle. (See
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
188 <tt>gaim::signal connect</tt>).
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
189
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
190 @c list returns a list of all known connections. The elements of
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
191 this list are appropriate as @c gc arguments to the other
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
192 @c gaim::connection subcommands or other commands requiring a gc.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
193
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
194 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
195 gaim::conv_send account who text
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
196 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
197
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
198 @c gaim::conv is simply a convenience wrapper for @c gaim::send_im and
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
199 <tt>gaim::conversation write</tt>. It sends the IM, determines the from
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
200 and to arguments for <tt>gaim::conversation write</tt>, and prints the text
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
201 sent to the conversation as one would expect. For the curious, you
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
202 may view the source for it by typing <tt>info body gaim::conv_send</tt> at
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
203 a Gaim Commander prompt.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
204
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
205 Note that an error in either @c gaim::send_im or <tt>gaim::conversation
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
206 write</tt> will not be caught by this procedure, and will be propagated
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
207 to the caller.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
208
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
209 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
210 gaim::conversation find ?-account account? name
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
211 gaim::conversation handle
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
212 gaim::conversation list
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
213 gaim::conversation new ?-chat? ?-im? account name
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
214 gaim::conversation write conversation style from to text
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
215 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
216
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
217 @c gaim::conversation provides an API for dealing with conversations.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
218 Given that Gaim is an instant messenger program, you'll probably
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
219 spend a lot of time here.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
220
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
221 The command @c find attempts to find an existing conversation with
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
222 username @c name. If the @c -account option is given, it refines its
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
223 search to include only conversations on that account.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
224
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
225 @c handle returns the conversations instance handle for the purposes
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
226 of signal connection. (See <tt>gaim::signal connect</tt>).
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
227
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
228 @c list returns a list of all currently open conversations.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
229
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
230 The @c new subcommand can be used to create a new conversation with
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
231 a specified user on a specified account if one does not exist, or
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
232 retrieve the existing conversation if it does. The @c -chat and
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
233 @c -im options specify whether the created conversation should be a
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
234 chat or a standard IM, respectively.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
235
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
236 @c write is used to write to the specified conversation. The @c style
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
237 argument specifies how the text should be printed -- as text coming
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
238 from the gaim user (style @c send), being sent to the gaim user
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
239 (style @c recv), or as a system message (such as "so-and-so has
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
240 signed off", style @c system). From is the name to whom the text
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
241 should be attributed -- you probably want to check for aliases here,
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
242 lest you confuse the user. @c text is the text to print.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
243
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
244 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
245 gaim::core handle
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
246 gaim::core quit
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
247 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
248
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
249 This command exposes functionality provided by the gaim core API.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
250
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
251 <tt>gaim::core handle</tt> returns a handle to the gaim core for signal
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
252 connection. (See <tt>gaim::signal connect</tt>).
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
253
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
254 @c quit exits gaim cleanly, and should be used in preference to the
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
255 tcl @c exit command. (Note that @c exit has not been removed,
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
256 however.)
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
257
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
258 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
259 gaim::debug level category message
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
260 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
261
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
262 Equivalent to the C gaim_debug function, this command outputs
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
263 debugging information to the gaim debug window (or stdout if gaim is
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
264 invoked with -d|--debug). The valid levels are, in increasing level
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
265 of severity, @c -misc, @c -info, @c -warning, and, or @c -error. @c
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
266 category is a short (a few characters ... for instance, "tcl" or "tcl
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
267 plugin") "topic" type name for this message, and @c message is the text
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
268 of the message. In the style of Tcl @e puts (and differing from
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
269 @e gaim_debug), no trailing \\n is required. (However, embedded newlines
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
270 may be generated with \\n).
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
271
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
272 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
273 gaim::notify ?type? title primary secondary
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
274 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
275
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
276 Also a direct equivalent to a C function, gaim_notify, this command
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
277 causes gaim to present the provided notification information to the
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
278 user via some appropriate UI method. The @c type argument, if
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
279 present, must be one of @c -error, @c -warning, or @c -info. The following
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
280 three arguments' absolute meanings may vary with the Gaim UI being
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
281 used (presently only a Gtk2 UI is available), but @c title should
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
282 generally be the title of the window, and @c primary and @c secondary
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
283 text within that window; in the Gtk2 UI, @c primary is slightly
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
284 larger than @c secondary and displayed in a @b boldface font.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
285
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
286 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
287 gaim::send_im gc who text
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
288 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
289
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
290 This sends an IM in the fashion of serv_send_im. @c gc is the GC of
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
291 the connection on which you wish to send (as returned by most event
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
292 handlers), @c who is the nick of the buddy to which you wish to send,
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
293 and @c text is the text of the message.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
294
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
295 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
296 gaim::signal connect instance signal args proc
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
297 gaim::signal disconnect instance signal
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
298 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
299
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
300 @c gaim::signal is a set of subcommands for dealing with gaim signals
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
301 (known as "events" prior to gaim 0.68).
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
302
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
303 The @c connect subcommand registers the procedure @c proc as a handler
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
304 for the signal @c signal on the instance @c instance. @c instance
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
305 should be an instance handle as returned by one of the @c handle
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
306 commands from the various parts of gaim. @c args and @ proc are as in
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
307 the Tcl @e proc command; note that the number of arguments in @c args
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
308 must match the number of arguments emitted by the signal exactly,
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
309 although you need not use them all. The procedure @c proc may be
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
310 either a simple command or a procedure in curly brackets. Note that
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
311 only one procedure may be associated with each signal; an attempt to
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
312 connect a second procedure to the same signal will remove the
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
313 existing binding and replace it with the new procedure.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
314 <tt>gaim::signal connect</tt> returns 0 on success and 1 on failure.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
315
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
316 @c disconnect removes any existing signal handler for the named
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
317 signal and instance.
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
318
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
319 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
320 gaim::unload
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
321 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
322
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
323 This unloads the current plugin. Note that preferences will not be
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
324 updated (yet).
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
325
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
326 @section Signals
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
327
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
328 Check the signals documentation for the meaning of these signals; this is
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
329 intended to be a list only of their arguments. Signal callbacks will
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
330 be made in their own namespace, and arguments to those signal
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
331 callbacks will live in the namespace @c event underneath that
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
332 namespace. To briefly illustrate, the signal @c receiving-im-msg is
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
333 provided with three arguments; the account on which the IM was
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
334 received, the screen name of the user sending the IM, and the text of
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
335 the IM. These arguments live in the variables @c event::account,
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
336 @c event::sender, and @c event::buffer, respectively. Therefore a callback
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
337 which notifies the user of an incoming IM containing the word 'shizzle'
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
338 might look like this:
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
339
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
340 @code
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
341 gaim::signal connect [gaim::conversation handle] receiving-im-msg {
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
342 if {[ string match "*shizzle*" $event::buffer ]} {
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
343 gaim::notify -info "tcl plugin" "Fo' shizzle" \
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
344 "$event::sender is down with the shizzle"
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
345 }
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
346 }
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
347 @endcode
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
348
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
349 Note that for some signals (notably @c receiving-im-msg, @c sending-im-msg,
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
350 and their chat counterparts), changes to the event arguments will
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
351 change the message itself from Gaim's vantage. For those signals
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
352 whose return value is meaningful, returning a value from the Tcl event
10410
bbad4ac630fa [gaim-migrate @ 11658]
Ethan Blanton <elb@pidgin.im>
parents: 10409
diff changeset
353 will return that value as it would in C.
10409
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
354
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
355 */
c3ecbb61e505 [gaim-migrate @ 11657]
Balwinder S Dheeman <bsd@rubyforge.org>
parents:
diff changeset
356
10410
bbad4ac630fa [gaim-migrate @ 11658]
Ethan Blanton <elb@pidgin.im>
parents: 10409
diff changeset
357 // vim: syntax=c tw=72 et

mercurial