comparison HACKING @ 960:fa681641643d

[gaim-migrate @ 970] *** MULTIPLE-CONNECTIONS *** committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 10 Oct 2000 00:02:02 +0000
parents df664ea5eced
children ae6d13c11570
comparison
equal deleted inserted replaced
959:034d5d1d53eb 960:fa681641643d
32 debugging information is printed to the debug window (which can be turned 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 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 34 of the information that's printed is useless anyway though; so the
35 --enable-debug option really doesn't do a whole lot. 35 --enable-debug option really doesn't do a whole lot.
36 36
37 This file was last modified by $Author: warmenhoven $ on $Date: 2000-10-09 05:18:19 -0400 (Mon, 09 Oct 2000) $. 37 This file was last modified by $Author: warmenhoven $ on $Date: 2000-10-09 20:02:02 -0400 (Mon, 09 Oct 2000) $.
38 38
39 39
40 PROGRAM FLOW 40 PROGRAM FLOW
41 ============ 41 ============
42 42
43 Before gaim does anything you can see, it initializes itself, which is 43 This has completely changed since multiple connections were added. Please
44 mostly just reading .gaimrc (handled by the functions in gaimrc.c). It 44 be patient; as soon as the code starts to settle this will get rewritten.
45 then draws the login window by calling show_login, and waits for input. 45 Most of the source files stayed the same though; only the one that got
46 46 added (multi.c) isn't covered below.
47 At the login window, when "signon" is clicked, dologin() is called. This
48 in turn calls serv_login, which checks to see if you want to use Oscar or
49 TOC, and calls oscar_login or toc_login appropriately. We'll assume TOC
50 for the rest of this discussion; Oscar has a lot of bad hacks to get it
51 working that I don't even want to think about.
52
53 After you're signed in (I'll skip that discussion - I doubt many people
54 are going to change the login process, since it pretty much just follows
55 PROTOCOL), Gaim draws the buddy list by calling show_buddy_list, and
56 waits for input from two places: the server and the user. The first place
57 it gets input from after signon is invariably the server, when the server
58 tells Gaim which buddies are signed on.
59
60 When there is information ready to be read from the server, toc_callback
61 is called (by GDK) to parse the incoming information. On an UPDATE,
62 serv_got_update is called, which takes care of things like notifying
63 conversation windows of the update if need be; notifying the plugins;
64 and finally, calling set_buddy.
65
66 set_buddy is one of the most frequently called functions in gaim, one of
67 the largest functions in gaim, and probably one of the buggiest functions
68 in gaim. It is responsible for updating the pixmaps in the buddy list;
69 notifying plugins of various events; updating the tooltips for buddies;
70 making sounds; and updating the ticker. It's also called once per online
71 buddy every 20 seconds (by GTK through update_all_buddies).
72
73 When the user opens a new conversation window, new_conversation is called.
74 That's easy enough. If there isn't a conversation with the person already
75 open (checked by calling find_conversation), show_conv is called to
76 create the new window. All sorts of neat things happen there, but it's
77 mostly drawing the window. show_conv is the best place to edit the UI. Be
78 prepared for some incredibly bad GTK programming. (Rob's fixing this as
79 we speak no doubt.)
80
81 That's pretty much it for the quick tutorial. I know it wasn't much but
82 it's enough to get you started. Make sure you know GTK before you get too
83 involved. Most of the back-end stuff is pretty basic; most of gaim is GTK.
84 47
85 48
86 SOURCE FILES 49 SOURCE FILES
87 ============ 50 ============
88 51