Mercurial > pidgin
annotate src/multi.h @ 4469:d76095396a0e
[gaim-migrate @ 4744]
Phase 2 of the conversation rewrite! Did you think I was done?
Okay everybody, the prefs page was slightly redesigned. Not much, though.
It needs an overhaul, and still, not everything works.. What we have now
is:
Conversations
|
|- IMs
|- Chats
`- Tabs
But that's not the good part of this patch. Oh no, not close. You see, in
Conversations, we now have a "Placement" drop-down box. Though this prefs
page is ugly and will eventually be redesigned, this gives you the
opportunity to set one of a number of different types of conversation
placement options.
The defaults are:
- Last created window: Adds the new conversation to the last created
window, like how things have been lately.
- New window: Adds the new conversation to a brand new window, every
time. Tabs are still there, so you can drag them between windows if you
want to manually group them.
- By group: This is my new favorite. This will put the new conversation
in whatever window it finds first that has another member from that
same group on your buddy list. If it doesn't find one, it creates a new
window. If the person you IM'd or the person who IM'd you is not on your
list, it gets put in a window with other people not on your list.
These are the only ones implemented, but don't think you're limited to
that. You see, we have new API functions for registering these
Conversation Placement functions. All a plugin would need to do is to write
a function, take into account OPT_CONVO_COMBINE (oh yeah, "Show IMs and
chats in same tabbed window" works again), make sure the conversation is
added _somewhere_, and then just register that function. If the plugin is
loaded, the user can select it from the existing drop-down box.
Cool, huh? Make sure to unregister the function when the plugin is
unloaded.
Have fun.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Thu, 30 Jan 2003 09:22:15 +0000 |
| parents | 0c68d402f59f |
| children | 3196d9044a45 |
| rev | line source |
|---|---|
| 960 | 1 /* |
| 2 * gaim | |
| 3 * | |
| 4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
| 5 * | |
| 6 * This program is free software; you can redistribute it and/or modify | |
| 7 * it under the terms of the GNU General Public License as published by | |
| 8 * the Free Software Foundation; either version 2 of the License, or | |
| 9 * (at your option) any later version. | |
| 10 * | |
| 11 * This program is distributed in the hope that it will be useful, | |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 * GNU General Public License for more details. | |
| 15 * | |
| 16 * You should have received a copy of the GNU General Public License | |
| 17 * along with this program; if not, write to the Free Software | |
| 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 19 * | |
| 20 */ | |
| 21 | |
|
2417
5473c8c5378d
[gaim-migrate @ 2430]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2402
diff
changeset
|
22 #ifndef _MULTI_H_ |
|
5473c8c5378d
[gaim-migrate @ 2430]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2402
diff
changeset
|
23 #define _MULTI_H_ |
| 960 | 24 |
|
2417
5473c8c5378d
[gaim-migrate @ 2430]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2402
diff
changeset
|
25 #include "core.h" |
| 960 | 26 |
| 27 /* ok. now the fun begins. first we create a connection structure */ | |
| 28 struct gaim_connection { | |
|
2438
5cbe86a444d9
[gaim-migrate @ 2451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
29 int edittype; /* XXX CUI: this is ui-specific and should be removed */ |
|
1391
d606da211acb
[gaim-migrate @ 1401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1376
diff
changeset
|
30 |
| 960 | 31 /* we need to do either oscar or TOC */ |
| 32 /* we make this as an int in case if we want to add more protocols later */ | |
| 33 int protocol; | |
|
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
34 struct prpl *prpl; |
|
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
35 guint32 flags; |
|
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
36 |
|
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
37 /* erg. */ |
|
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
38 char *checkbox; |
| 960 | 39 |
|
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
40 /* all connections need an input watcher */ |
|
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
41 int inpa; |
| 960 | 42 |
|
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
43 /* all connections need a list of chats, even if they don't have chat */ |
|
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
44 GSList *buddy_chats; |
| 960 | 45 |
|
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
46 /* each connection then can have its own protocol-specific data */ |
|
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
47 void *proto_data; |
| 960 | 48 |
|
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
49 struct aim_user *user; |
|
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
50 |
| 960 | 51 char username[64]; |
|
2210
3a6fd1e8f00a
[gaim-migrate @ 2220]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2205
diff
changeset
|
52 char displayname[128]; |
| 960 | 53 char password[32]; |
|
1153
3063e6743913
[gaim-migrate @ 1163]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
54 guint keepalive; |
|
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3517
diff
changeset
|
55 |
| 960 | 56 /* stuff needed for per-connection idle times */ |
|
2438
5cbe86a444d9
[gaim-migrate @ 2451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
57 guint idle_timer; |
| 960 | 58 time_t login_time; |
| 59 time_t lastsent; | |
| 60 int is_idle; | |
|
1995
815997c7d4f1
[gaim-migrate @ 2005]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1942
diff
changeset
|
61 time_t correction_time; |
|
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
62 |
|
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3517
diff
changeset
|
63 char *away; /* set by protos, is NULL when not away, or set * |
|
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3517
diff
changeset
|
64 * to "" or a custom message when away */ |
|
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3517
diff
changeset
|
65 char *away_state; /* updated by serv_set_away, keeps the last set * |
|
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3517
diff
changeset
|
66 * away type */ |
|
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3517
diff
changeset
|
67 int is_auto_away; /* used by idle.c */ |
|
1771
213607e89598
[gaim-migrate @ 1781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1468
diff
changeset
|
68 |
|
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3517
diff
changeset
|
69 int evil; /* warning level for AIM (why is this here?) */ |
|
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3517
diff
changeset
|
70 gboolean wants_to_die; /* defaults to FALSE */ |
| 960 | 71 }; |
| 72 | |
|
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
73 #define OPT_CONN_HTML 0x00000001 |
|
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3517
diff
changeset
|
74 /* set this flag on a gc if you want serv_got_im to autoreply when away */ |
|
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
3517
diff
changeset
|
75 #define OPT_CONN_AUTO_RESP 0x00000002 |
|
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
76 |
|
2154
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
77 struct proto_user_opt { |
|
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
78 char *label; |
|
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
79 char *def; |
|
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
80 int pos; |
|
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
81 }; |
|
cff133e0ec0c
[gaim-migrate @ 2164]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2153
diff
changeset
|
82 |
| 4333 | 83 struct proto_actions_menu { |
| 84 char *label; | |
| 85 void (*callback)(struct gaim_connection *); | |
| 86 struct gaim_connection *gc; | |
| 87 }; | |
| 88 | |
|
2170
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2154
diff
changeset
|
89 struct proto_buddy_menu { |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2154
diff
changeset
|
90 char *label; |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2154
diff
changeset
|
91 void (*callback)(struct gaim_connection *, char *); |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2154
diff
changeset
|
92 struct gaim_connection *gc; |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2154
diff
changeset
|
93 }; |
|
c24595d3c364
[gaim-migrate @ 2180]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2154
diff
changeset
|
94 |
|
2204
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2197
diff
changeset
|
95 struct proto_chat_entry { |
|
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2197
diff
changeset
|
96 char *label; |
|
2205
cff4fbe01c7b
[gaim-migrate @ 2215]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2204
diff
changeset
|
97 char *def; |
|
2204
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2197
diff
changeset
|
98 gboolean is_int; |
|
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2197
diff
changeset
|
99 int min; |
|
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2197
diff
changeset
|
100 int max; |
|
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2197
diff
changeset
|
101 }; |
|
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2197
diff
changeset
|
102 |
| 960 | 103 /* now that we have our struct, we're going to need lots of them. Maybe even a list of them. */ |
| 104 extern GSList *connections; | |
| 105 | |
| 3517 | 106 /* number of accounts that are currently in the process of connecting */ |
| 107 extern int connecting_count; | |
| 108 | |
|
1942
ba421d552093
[gaim-migrate @ 1952]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1817
diff
changeset
|
109 struct aim_user *new_user(const char *, int, int); |
|
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1068
diff
changeset
|
110 struct gaim_connection *new_gaim_conn(struct aim_user *); |
| 960 | 111 void destroy_gaim_conn(struct gaim_connection *); |
| 112 | |
|
2204
5014b802eb41
[gaim-migrate @ 2214]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2197
diff
changeset
|
113 void regenerate_user_list(); |
| 960 | 114 |
|
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1068
diff
changeset
|
115 void account_online(struct gaim_connection *); |
| 960 | 116 void account_offline(struct gaim_connection *); |
| 117 | |
| 118 void auto_login(); | |
| 119 | |
|
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
120 void set_login_progress(struct gaim_connection *, float, char *); |
|
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
121 void hide_login_progress(struct gaim_connection *, char *); |
| 2956 | 122 void hide_login_progress_notice(struct gaim_connection *, char *); |
| 3074 | 123 void hide_login_progress_error(struct gaim_connection *, char *); |
|
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
124 |
|
2417
5473c8c5378d
[gaim-migrate @ 2430]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2402
diff
changeset
|
125 #endif /* _MULTI_H_ */ |
