Mercurial > pidgin
annotate HACKING @ 1010:4dca3277ea15
[gaim-migrate @ 1020]
Fix for PPC systems.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Fri, 20 Oct 2000 03:35:38 +0000 |
parents | 82c5865f7cfe |
children | daad2440a642 |
rev | line source |
---|---|
639 | 1 A lot of people have tried to hack gaim, but haven't been able to because |
2 the code is just so horrid. Well, the code isn't getting better anytime | |
3 soon, so to help all you would-be hackers help out gaim, here's a brief | |
4 tutorial on how gaim works. I'll quickly describe the logical flow of | |
5 things, then what you'll find in each of the source files. Hopefully | |
6 that's enough to get most of you going. | |
7 | |
708
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
8 If you're going to hack gaim, PLEASE, PLEASE PLEASE PLEASE send patches |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
9 against the absolute latest CVS. I get really annoyed when I get patches |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
10 against the last released version, especially since I don't usually have |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
11 a copy of it on my computer, and gaim tends to change a lot between |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
12 versions. (I sometimes get annoyed when they're against CVS from 3 days |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
13 ago, but can't complain because it's usually my fault that I haven't |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
14 looked at the patch yet.) To get gaim from CVS (if you haven't already), |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
15 run the following commands: |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
16 |
774
b61607d6c2af
[gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
749
diff
changeset
|
17 $ export CVSROOT=:pserver:anonymous@cvs.gaim.sourceforge.net:/cvsroot/gaim |
708
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
18 $ cvs login |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
19 (hit enter as the password) |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
20 $ cvs co gaim |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
21 (you'll see it getting all of the files) |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
22 $ cd gaim |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
23 $ ./gen |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
24 |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
25 You'll now have your normal gaim tree with ./configure and all. (If you |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
26 want to make your life really simple, learn how CVS works. CVS is your |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
27 friend.) |
3ff8b997cd37
[gaim-migrate @ 718]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
706
diff
changeset
|
28 |
639 | 29 There's one little thing that's just a pet peeve, and it's really stupid. |
706
a9758452f3c4
[gaim-migrate @ 716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
684
diff
changeset
|
30 In ./configure there's an --enable-debug option. This does two things: |
639 | 31 compiles with -Wall, and prints debugging information to stdout. The |
32 debugging information is printed to the debug window (which can be turned | |
33 on in the preferences) whether or not --enable-debug was selected. Most | |
34 of the information that's printed is useless anyway though; so the | |
35 --enable-debug option really doesn't do a whole lot. | |
36 | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
979
diff
changeset
|
37 This file was last modified by $Author: warmenhoven $ on $Date: 2000-10-12 14:59:36 -0400 (Thu, 12 Oct 2000) $. |
684
b29c92be568b
[gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
639
diff
changeset
|
38 |
639 | 39 |
40 PROGRAM FLOW | |
41 ============ | |
42 | |
979
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
43 Before gaim does anything you can see, it initializes itself, which is |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
44 mostly just reading .gaimrc (handled by the functions in gaimrc.c). It |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
45 then draws the login window by calling show_login, and waits for input. |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
46 |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
47 At the login window, when "Accounts" is clicked, account_editor() is |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
48 called. (NOTE: the login window will probably be changed soon.) This |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
49 then displays all of the users and various information about them. |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
50 |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
51 When the "Sign on/off" button is clicked, serv_login is passed the |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
52 username and the password for the account. If the password length is |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
53 zero (the password field is a character array rather than pointer so |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
54 it will not be NULL) then the Signon callback will prompt for the |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
979
diff
changeset
|
55 password before calling serv_login. serv_login then signs in the user |
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
979
diff
changeset
|
56 using the appropriate protocol. We'll assume TOC for the rest of this |
979
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
57 discussion; Oscar has a lot of bad hacks to get it working that I don't |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
58 even want to think about. |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
59 |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
60 After you're signed in (I'll skip that discussion - I doubt many people |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
61 are going to change the login process, since it pretty much just follows |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
62 PROTOCOL), Gaim draws the buddy list by calling show_buddy_list, and |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
63 waits for input from two places: the server and the user. The first place |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
64 it gets input from after signon is invariably the server, when the server |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
65 tells Gaim which buddies are signed on. |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
66 |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
67 When there is information ready to be read from the server, toc_callback |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
68 is called (by GDK) to parse the incoming information. On an UPDATE, |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
69 serv_got_update is called, which takes care of things like notifying |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
70 conversation windows of the update if need be; notifying the plugins; |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
71 and finally, calling set_buddy. |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
72 |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
73 set_buddy is one of the most frequently called functions in gaim, one of |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
74 the largest functions in gaim, and probably one of the buggiest functions |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
75 in gaim. It is responsible for updating the pixmaps in the buddy list; |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
76 notifying plugins of various events; updating the tooltips for buddies; |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
77 making sounds; and updating the ticker. It's also called once per online |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
78 buddy every 20 seconds per connection (by GTK through update_all_buddies). |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
79 |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
80 New connections happen the exact same way as described above. Each aim_user |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
81 can have one gaim_connection associated with it. aim_user and gaim_connection |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
82 both have a protocol field; gaim_connection's should be constant once it is |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
83 set in the appropriate (protocol)_login function. There are lots of details |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
84 that are connected with multiple connections that are best explained by |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
85 reading the code. |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
86 |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
87 When the user opens a new conversation window, new_conversation is called. |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
88 That's easy enough. If there isn't a conversation with the person already |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
89 open (checked by calling find_conversation), show_conv is called to |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
90 create the new window. All sorts of neat things happen there, but it's |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
91 mostly drawing the window. show_conv is the best place to edit the UI. Be |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
92 prepared for some incredibly bad GTK programming. (Rob's fixing this as |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
93 we speak no doubt.) |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
94 |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
95 That's pretty much it for the quick tutorial. I know it wasn't much but |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
96 it's enough to get you started. Make sure you know GTK before you get too |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
97 involved. Most of the back-end stuff is pretty basic; most of gaim is GTK. |
639 | 98 |
99 | |
100 SOURCE FILES | |
101 ============ | |
102 | |
103 about.c: | |
104 Not much to say here, just a few basic functions. | |
105 | |
106 aim.c: | |
107 This is where the main() function is. It takes care of a lot of the | |
108 initialization stuff, and showing the login window. It's pretty tiny | |
109 and there's not really much to edit in it. Watch out for bad Oscar | |
110 sign in hacks. | |
111 | |
112 away.c: | |
113 This takes care of most of the away stuff: setting the away message | |
114 (do_im_away); coming back (do_im_back); drawing the away window; | |
115 etc. To be honest I haven't looked at this file in months. | |
116 | |
117 browser.c: | |
118 Code for opening a browser window. Most of the code is trying to deal | |
119 with Netscape. The most important function here is open_url. Have fun. | |
120 | |
121 buddy.c: | |
122 This takes care of not only nearly everything buddy-related (the buddy | |
123 list, the permit/deny lists, and the window), but also a lot of the | |
124 code flow and util functions. Look for good things like find_buddy, | |
125 set_buddy, and signoff() here. | |
126 | |
127 buddy_chat.c: | |
128 This takes care of the buddy chat stuff. This used to be a lot bigger | |
129 until the chat and IM windows got merged in the code. Now it mostly | |
130 just takes care of chat-specific stuff, like ignoring people and | |
131 keeping track of who's in the room. This is also where the chat window | |
132 is created. | |
133 | |
134 conversation.c: | |
135 This is where most of the functions dealing with the IM and chat windows | |
136 are hidden. It tries to abstract things as much as possible, but doesn't | |
137 do a very good job. This is also where things like "Enter sends" and | |
138 "Ctrl-{B/I/U/S}" options get carried out (look for send_callback). The | |
139 chat and IM toolbar (with the B/I/U/S buttons) are both built from the | |
140 same function, build_conv_toolbar. | |
141 | |
142 dialogs.c: | |
143 A massive file with a lot of little utility functions. This is where | |
144 all of those little dialog windows are created. Things like the warn | |
145 dialog and the add buddy dialog are here. Not all of the dialogs in | |
146 gaim are in this file, though. But most of them are. This is also | |
147 where do_import is housed, to import buddy lists. | |
148 | |
149 gaimrc.c: | |
150 This controls everything about the .gaimrc file. There's not really much | |
151 to say about it; this is probably one of the better designed and easier | |
152 to follow files in gaim. The important functions are towards the bottom. | |
153 | |
154 gnome_applet_mgr.c: | |
155 A hideous creation from the days before I started working on gaim. Most | |
156 of it works, but it has functionsLikeThis. I hate looking at this | |
157 file, but I'm too lazy to change the functions. The best functions | |
158 are things like set_applet_draw_open, whose sole purpose is to set a | |
749
94edd99b7302
[gaim-migrate @ 759]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
708
diff
changeset
|
159 global variable to TRUE. [ note 8/22/00 - I finally changed this file. ] |
639 | 160 |
161 gtkhtml.c: | |
162 This is really just one big hack. It started off as an HTML widget that | |
163 was written for Gnome as far as I can tell. The current version is | |
164 huge, requires way too many libs, and is too hard to upgrade to. But | |
165 we've managed to hack this poor old version into basically what we | |
166 need it for. I recommend not looking at this file if you want to save | |
167 your sanity. | |
168 | |
169 gtkticker.c: | |
170 Syd, our resident GTK God, wrote a GtkWidget, GtkTicker. This is that | |
171 widget. It's cool, and it's tiny. | |
172 | |
173 html.c: | |
174 Don't ask my why this is called html.c. Most of it is just grab_url, | |
175 which does like the name says; it downloads a URL to show in the | |
176 GtkHTML widget. http.c would be a more appropriate name, but that's OK. | |
177 | |
178 idle.c: | |
179 There is a very good reason why this file is still on version 1.1 | |
180 in CVS. The entire thing is #if 0'd out. I haven't ever really taken | |
181 a good look at it, but I think what it was supposed to have done is | |
182 set you as being away when a screensaver came on. | |
183 | |
979
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
184 multi.c: |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
185 This is the file that tries to take care of most of the major issues |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
186 with multiple connections. The best function in here by far is the |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
187 account_editor(). auto_login() is also in here (I'm just reading |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
188 multi.h now...); auto_login has problems. Someone please fix it. |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
189 account_editor is really the only function that the UI needs to be |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
190 concerned with. If you want to remove multiconnectivity from gaim, |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
191 all you would really need to do is comment out any lines that make |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
192 reference to this function (there are only two - one in aim.c and one |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
193 in buddy.c). The login window UI would have to be changed but it would |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
194 be simple to take an old version of gaim and copy code (it won't drop-in |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
195 because there were other changes, but it should be simple to hand-edit). |
ae6d13c11570
[gaim-migrate @ 989]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
196 |
639 | 197 network.c: |
198 This has two functions: get_address and connect_address, both of which | |
199 call proxy functions. If you want to see how these are used, look at | |
200 toc.c and/or rvous.c. These are really just front-ends to the proxy | |
201 stuff; use these instead of calling the proxy functions. | |
202 | |
203 oscar.c: | |
204 One big hack of copied code. This is supposed to be the libfaim tie-in | |
205 in gaim. Most of it is just copied straight from faimtest, the small | |
206 program that comes with libfaim. I'm not even sure how half of it works, | |
207 if that makes you feel any better. | |
208 | |
209 perl.c: | |
210 This was basically copied straight from X-Chat through the power of | |
211 the GPL. Perl is the biggest, most confusing piece of C code I've ever | |
212 seen in my life (and keep in mind I'm a gaim hacker). I have a basic | |
213 idea of what's going on in it, but I couldn't tell you exactly. The | |
214 top half sets up perl and tells it what's going on and the bottom half | |
215 implements the AIM module. | |
216 | |
217 plugins.c: | |
218 This is the "plugin plug", as the file states. This file is probably | |
219 the only file in all of gaim that at the top has all of the functions | |
220 and global and static variables named out for you. It makes reading | |
221 it a little easier, but not by much. A lot of the code in here deals | |
222 with the plugin window rather than the plugins themselves. | |
223 | |
224 prefs.c: | |
225 The important function in here is build_prefs, but the most useful | |
226 function is gaim_button. build_prefs draws the window, and calls | |
227 gaim_button probably 30 or 40 times. (I don't really wanna run grep | |
228 | wc to count.) This is where you add the toggle button for gaim | |
229 preferences. It's very simple, and if you look at a couple of the | |
230 calls to gaim_button you'll figure it out right away. | |
231 | |
232 proxy.c: | |
233 This is where the bulk of the actual networking code is done. The big | |
234 function here is proxy_connect, which will connect through the proxy | |
235 setup you've chosen (most of which don't work...) or just regularly. | |
236 | |
237 rvous.c: | |
238 This was originally going to be the stuff for all of the Buddy Icon | |
239 and Voice Chat stuff, but I got really sick of protocol hacking really | |
240 quick. Now it only houses the file transfer stuff, which only works | |
241 for TOC. | |
242 | |
243 server.c: | |
244 This is where all of the differentiation between TOC and Oscar is | |
245 done. Nearly everything that's network related goes through here | |
246 at one point or another. This has good things like serv_send_im and | |
247 serv_got_update. Most of it should be pretty self-explanatory. | |
248 | |
249 sound.c: | |
250 The big important function is play_sound, which plays one of 4 (actually | |
251 6) sounds. One of the sounds is called in 3 different events, which | |
252 is why there are actually 6 sounds. This then calls play which then | |
253 checks for esd, then nas if that's not available, then falls back | |
254 to /dev/audio. | |
255 | |
256 ticker.c: | |
257 Syd is just so cool. I really can't get over it. He let me come | |
258 visit him at Netscape one day, and I got to see all of their toys | |
259 (don't worry, I'm under an NDA). Anyway, this file is for the buddy | |
260 ticker. This is also a damn cool file because it's got all of the | |
261 functions that you'd want right up at the top. Someday I want to be | |
262 as cool as Syd. | |
263 | |
264 toc.c: | |
265 This handles everything TOC-related, including parsing gaim's buddy | |
266 list. Most of this file is toc_callback, which parses the incoming | |
267 information from the server. I really don't like TOC though. | |
268 | |
269 util.c: | |
270 There's not really a lot of cohesion to this file; it's just a lot of | |
271 stuff that happened to be thrown into it for no apparent reason. None | |
272 of it is particularly tasty; it's all just utility functions. Just | |
273 like the name says. | |
274 | |
275 | |
276 So that's our little tour of the internals of Gaim. It's really not | |
277 difficult to figure out if you've spent any time with GTK. I'm looking | |
278 forward to getting all of your patches :) |