Mercurial > pidgin
annotate src/gtkblist.h @ 10458:ad9258716144
[gaim-migrate @ 11727]
This should fix sf bug #1093455
Basically it's possible for people to kick you from an AIM chat room, and
I don't think there's anything we can do about this. When this happens
you can't rejoin, and I don't think there's anything we can do about
that, either.
But now, at least oscar will tell the core you're no longer in the chat
room when you've been kicked. i.e. it changes the chat title from
"My Lame Chat" to "(My Lame Chat)"
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 31 Dec 2004 05:42:26 +0000 |
parents | 0c985021a1d8 |
children | ec82cbb21fe8 |
rev | line source |
---|---|
5228 | 1 /** |
5248 | 2 * @file gtkblist.h GTK+ Buddy List API |
5228 | 3 * @ingroup gtkui |
4 * | |
5 * gaim | |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
5906 | 10 * |
5228 | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
9713 | 25 #ifndef _GAIM_GTKBLIST_H_ |
26 #define _GAIM_GTKBLIST_H_ | |
5228 | 27 |
10008 | 28 typedef struct _GaimGtkBuddyList GaimGtkBuddyList; |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5631
diff
changeset
|
29 |
5228 | 30 enum { |
31 STATUS_ICON_COLUMN, | |
32 STATUS_ICON_VISIBLE_COLUMN, | |
33 NAME_COLUMN, | |
34 WARNING_COLUMN, | |
35 IDLE_COLUMN, | |
36 BUDDY_ICON_COLUMN, | |
37 NODE_COLUMN, | |
38 BLIST_COLUMNS | |
10008 | 39 |
40 }; | |
5228 | 41 |
42 typedef enum { | |
43 GAIM_STATUS_ICON_LARGE, | |
44 GAIM_STATUS_ICON_SMALL | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
45 |
5228 | 46 } GaimStatusIconSize; |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
47 |
10008 | 48 #include "gtkgaim.h" |
49 #include "blist.h" | |
50 | |
5228 | 51 /************************************************************************** |
52 * @name Structures | |
53 **************************************************************************/ | |
54 /** | |
55 * Like, everything you need to know about the gtk buddy list | |
56 */ | |
10008 | 57 struct _GaimGtkBuddyList { |
5228 | 58 GtkWidget *window; |
59 GtkWidget *vbox; /**< This is the vbox that everything gets packed into. Your plugin might | |
60 want to pack something in it itself. Go, plugins! */ | |
61 | |
62 GtkWidget *treeview; /**< It's a treeview... d'uh. */ | |
63 GtkTreeStore *treemodel; /**< This is the treemodel. */ | |
6695 | 64 GtkTreeViewColumn *idle_column, |
65 *warning_column, | |
5228 | 66 *buddy_icon_column; |
67 | |
5427 | 68 GtkItemFactory *ift; |
5228 | 69 GtkWidget *bpmenu; /**< The buddy pounce menu. */ |
70 | |
71 guint refresh_timer; /**< The timer for refreshing every 30 seconds */ | |
72 | |
73 guint timeout; /**< The timeout for the tooltip. */ | |
10354 | 74 guint drag_timeout; /**< The timeout for expanding contacts on drags */ |
7636 | 75 GdkRectangle tip_rect; /**< This is the bounding rectangle of the |
76 cell we're currently hovering over. This is | |
77 used for tooltips. */ | |
78 GdkRectangle contact_rect; /**< This is the bounding rectangle of the contact node | |
79 and its children. This is used for auto-expand on | |
80 mouseover. */ | |
81 GaimBlistNode *mouseover_contact; /**< This is the contact currently mouse-over expanded */ | |
82 | |
5228 | 83 GtkWidget *tipwindow; /**< The window used by the tooltip */ |
84 | |
85 GaimBlistNode *selected_node; /**< The currently selected node */ | |
86 | |
7304 | 87 GdkPixbuf *east, *south; /**< Drop shadow stuff */ |
88 GdkWindow *east_shadow, *south_shadow; /**< Drop shadow stuff */ | |
89 | |
10008 | 90 }; |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
91 |
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
92 #define GAIM_GTK_BLIST(list) ((GaimGtkBuddyList *)(list)->ui_data) |
5228 | 93 #define GAIM_IS_GTK_BLIST(list) \ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
94 ((list)->ui_ops == gaim_gtk_blist_get_ui_ops()) |
5228 | 95 |
96 /************************************************************************** | |
5422 | 97 * @name GTK+ Buddy List API |
5228 | 98 **************************************************************************/ |
5906 | 99 |
100 /** | |
8815 | 101 * Get the handle for the GTK+ blist system. |
102 * | |
103 * @return the handle to the blist system | |
104 */ | |
105 void *gaim_gtk_blist_get_handle(); | |
106 | |
107 /** | |
5906 | 108 * Initializes the GTK+ blist system. |
109 */ | |
110 void gaim_gtk_blist_init(void); | |
111 | |
5228 | 112 /** |
8815 | 113 * Uninitializes the GTK+ blist system. |
114 */ | |
115 void gaim_gtk_blist_uninit(void); | |
116 | |
117 /** | |
5228 | 118 * Returns the UI operations structure for the buddy list. |
119 * | |
120 * @return The GTK list operations structure. | |
121 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
122 GaimBlistUiOps *gaim_gtk_blist_get_ui_ops(void); |
5228 | 123 |
124 /** | |
125 * Returns the base image to represent the account, based on the currently selected theme | |
126 * | |
127 * @param account The account. | |
6695 | 128 * |
5228 | 129 * @return The icon |
130 */ | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5427
diff
changeset
|
131 GdkPixbuf *create_prpl_icon(GaimAccount *account); |
5228 | 132 |
133 /** | |
9774 | 134 * Populates a menu with the items shown on the buddy list for a buddy. |
135 * | |
136 * @param menu The menu to populate | |
137 * @param buddy The buddy who's menu to get | |
138 */ | |
139 void gaim_gtk_blist_make_buddy_menu(GtkWidget *menu, GaimBuddy *buddy); | |
140 | |
141 /** | |
5228 | 142 * Refreshes all the nodes of the buddy list. |
143 * This should only be called when something changes to affect most of the nodes (such as a ui preference changing) | |
144 * | |
145 * @param list This is the core list that gets updated from | |
146 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
147 void gaim_gtk_blist_refresh(GaimBuddyList *list); |
5228 | 148 |
149 /** | |
150 * Tells the buddy list to update its toolbar based on the preferences | |
151 * | |
152 */ | |
153 void gaim_gtk_blist_update_toolbar(); | |
154 | |
155 /** | |
156 * Useful for the docklet plugin and also for the win32 tray icon | |
6695 | 157 * This is called when one of those is clicked--it will show/hide the |
158 * buddy list/login window--depending on which is active | |
5228 | 159 */ |
160 void gaim_gtk_blist_docklet_toggle(); | |
161 void gaim_gtk_blist_docklet_add(); | |
162 void gaim_gtk_blist_docklet_remove(); | |
163 void gaim_gtk_blist_update_columns(); | |
5411 | 164 void gaim_gtk_blist_update_refresh_timeout(); |
5228 | 165 |
166 /** | |
167 * Useful for the buddy ticker | |
168 */ | |
5234 | 169 GdkPixbuf *gaim_gtk_blist_get_status_icon(GaimBlistNode *node, |
5228 | 170 GaimStatusIconSize size); |
171 | |
5422 | 172 /************************************************************************** |
173 * @name GTK+ Buddy List sorting functions | |
174 **************************************************************************/ | |
175 | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
176 typedef GtkTreeIter (*gaim_gtk_blist_sort_function)(GaimBlistNode *new, GaimBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur); |
5422 | 177 |
178 extern GSList *gaim_gtk_blist_sort_methods; | |
179 | |
180 struct gaim_gtk_blist_sort_method { | |
5631 | 181 char *id; |
5422 | 182 char *name; |
183 gaim_gtk_blist_sort_function func; | |
184 }; | |
185 | |
186 /** | |
187 * Registers a buddy list sorting method. | |
188 * | |
5631 | 189 * @param id The unique ID of the sorting method |
5422 | 190 * @param name The method's name. |
191 * @param func A pointer to the function. | |
192 * | |
193 */ | |
5631 | 194 void gaim_gtk_blist_sort_method_reg(const char *id, const char *name, gaim_gtk_blist_sort_function func); |
5422 | 195 |
196 /** | |
197 * Unregisters a buddy list sorting method. | |
198 * | |
5631 | 199 * @param id The method's id |
5422 | 200 */ |
5631 | 201 void gaim_gtk_blist_sort_method_unreg(const char *id); |
5422 | 202 |
203 /** | |
204 * Sets a buddy list sorting method. | |
205 * | |
5631 | 206 * @param id The method's id. |
5422 | 207 */ |
5631 | 208 void gaim_gtk_blist_sort_method_set(const char *id); |
5422 | 209 |
210 /** | |
211 * Sets up the programs default sort methods | |
212 */ | |
213 void gaim_gtk_blist_setup_sort_methods(); | |
214 | |
5936
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
215 /** |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
216 * Updates the protocol actions menu on the GTK+ buddy list window. |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
217 */ |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
218 void gaim_gtk_blist_update_protocol_actions(); |
5422 | 219 |
8305
57bdd25752c1
[gaim-migrate @ 9029]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
220 /** |
8986 | 221 * Updates the plugin actions menu on the GTK+ buddy list window. |
222 */ | |
223 void gaim_gtk_blist_update_plugin_actions(); | |
224 | |
225 /** | |
8940 | 226 * Determines if showing the join chat dialog is a valid action. |
227 * | |
228 * @return Returns TRUE if there are accounts online capable of | |
229 * joining chat rooms. Otherwise returns FALSE. | |
8305
57bdd25752c1
[gaim-migrate @ 9029]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
230 */ |
8940 | 231 gboolean gaim_gtk_blist_joinchat_is_showable(void); |
232 | |
233 /** | |
234 * Shows the join chat dialog. | |
235 */ | |
236 void gaim_gtk_blist_joinchat_show(void); | |
5422 | 237 |
9051 | 238 /** |
239 * Appends the protocol specific menu items for a GaimBlistNode | |
240 */ | |
241 void gaim_gtk_append_blist_node_proto_menu (GtkWidget *menu, GaimConnection *gc, GaimBlistNode *node); | |
242 | |
243 /** | |
244 * Appends the extended menu items for a GaimBlistNode | |
245 */ | |
246 void gaim_gtk_append_blist_node_extended_menu(GtkWidget *menu, GaimBlistNode *node); | |
247 | |
9713 | 248 #endif /* _GAIM_GTKBLIST_H_ */ |