comparison plugins/timestamp.c @ 4359:5fb47ec9bfe4

[gaim-migrate @ 4625] Wow, okay, where to begin with this one ;) I rewrote the whole conversation backend. It is now core/UI split. Here's how it works.. Every conversation is represented by a gaim_conversation structure. This branches out into gaim_im and gaim_chat structures. Every conversation lives in (well, normally, but it doesn't have to) a gaim_window structure. This is a _CORE_ representation of a window. There can be multiple gaim_window structures around. The gaim_window and gaim_conversation structures have UI-specific operation structures associated with them. At the moment, the only UI is GTK+, and this will be for some time. Don't start thinking you can write a QT UI now. It's just not going to happen. Everything that is done on a conversation is done through the core API. This API does core processing and then calls the UI operations for the rendering and anything else. Now, what does this give the user? - Multiple windows. - Multiple tabs per window. - Draggable tabs. - Send As menu is moved to the menubar. - Menubar for chats. - Some very cool stuff in the future, like replacing, say, IRC chat windows with an X-Chat interface, or whatever. - Later on, customizable window/conversation positioning. For developers: - Fully documented API - Core/UI split - Variable checking and mostly sane handling of incorrect variables. - Logical structure to conversations, both core and UI. - Some very cool stuff in the future, like replacing, say, IRC chat windows with an X-Chat interface, or whatever. - Later on, customizable window/conversation positioning. - Oh yeah, and the beginning of a stock icon system. Now, there are things that aren't there yet. You will see tabs even if you have them turned off. This will be fixed in time. Also, the preferences will change to work with the new structure. I'm starting school in 2 days, so it may not be done immediately, but hopefully in the next week. Enjoy! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 20 Jan 2003 09:10:23 +0000
parents 0cff8ec38935
children 2c985a9e994c
comparison
equal deleted inserted replaced
4358:2b8abf7f9cc1 4359:5fb47ec9bfe4
19 GModule *handle; 19 GModule *handle;
20 GSList *timestamp_timeouts; 20 GSList *timestamp_timeouts;
21 21
22 gboolean do_timestamp (gpointer data) 22 gboolean do_timestamp (gpointer data)
23 { 23 {
24 struct conversation *c = data; 24 struct gaim_conversation *c = (struct gaim_conversation *)data;
25 char *buf; 25 char *buf;
26 char mdate[6]; 26 char mdate[6];
27 time_t tim = time(NULL); 27 time_t tim = time(NULL);
28 28
29 if (!g_list_find(conversations, c)) 29 if (!g_list_find(conversations, c))
30 return FALSE; 30 return FALSE;
31 31
32 strftime(mdate, sizeof(mdate), "%H:%M", localtime(&tim)); 32 strftime(mdate, sizeof(mdate), "%H:%M", localtime(&tim));
33 buf = g_strdup_printf(" %s", mdate); 33 buf = g_strdup_printf(" %s", mdate);
34 write_to_conv(c, buf, WFLAG_NOLOG, NULL, tim, -1); 34 gaim_conversation_write(c, NULL, buf, WFLAG_NOLOG, tim, -1);
35 g_free(buf); 35 g_free(buf);
36 return TRUE; 36 return TRUE;
37 } 37 }
38 38
39 void timestamp_new_convo(char *name) 39 void timestamp_new_convo(char *name)
40 { 40 {
41 struct conversation *c = find_conversation(name); 41 struct gaim_conversation *c = gaim_find_conversation(name);
42 do_timestamp(c); 42 do_timestamp(c);
43 43
44 timestamp_timeouts = g_slist_append(timestamp_timeouts, 44 timestamp_timeouts = g_slist_append(timestamp_timeouts,
45 GINT_TO_POINTER(g_timeout_add(timestamp, do_timestamp, c))); 45 GINT_TO_POINTER(g_timeout_add(timestamp, do_timestamp, c)));
46 46
98 } 98 }
99 99
100 100
101 char *gaim_plugin_init(GModule *h) { 101 char *gaim_plugin_init(GModule *h) {
102 GList *cnvs = conversations; 102 GList *cnvs = conversations;
103 struct conversation *c; 103 struct gaim_conversation *c;
104 handle = h; 104 handle = h;
105 105
106 while (cnvs) { 106 while (cnvs) {
107 c = cnvs->data; 107 c = cnvs->data;
108 timestamp_new_convo(c->name); 108 timestamp_new_convo(c->name);