Mercurial > pidgin.yaz
annotate src/gtkblist.h @ 8664:f95edb58087c
[gaim-migrate @ 9416]
Marc E. (elcomandante) made us a new jabber icon that isn't quite so out
of focus. Thanks Marc!
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Wed, 14 Apr 2004 12:40:49 +0000 |
parents | 57bdd25752c1 |
children | ada0cf2f49fe |
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 */ | |
25 | |
26 #ifndef _GAIM_GTK_LIST_H_ | |
27 #define _GAIM_GTK_LIST_H_ | |
28 | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5631
diff
changeset
|
29 #include "blist.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5631
diff
changeset
|
30 |
5228 | 31 enum { |
32 STATUS_ICON_COLUMN, | |
33 STATUS_ICON_VISIBLE_COLUMN, | |
34 NAME_COLUMN, | |
35 WARNING_COLUMN, | |
36 IDLE_COLUMN, | |
37 BUDDY_ICON_COLUMN, | |
38 NODE_COLUMN, | |
39 BLIST_COLUMNS | |
40 }; | |
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 |
5228 | 48 /************************************************************************** |
49 * @name Structures | |
50 **************************************************************************/ | |
51 /** | |
52 * Like, everything you need to know about the gtk buddy list | |
53 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
54 typedef struct { |
5228 | 55 GtkWidget *window; |
56 GtkWidget *vbox; /**< This is the vbox that everything gets packed into. Your plugin might | |
57 want to pack something in it itself. Go, plugins! */ | |
58 | |
59 GtkWidget *treeview; /**< It's a treeview... d'uh. */ | |
60 GtkTreeStore *treemodel; /**< This is the treemodel. */ | |
6695 | 61 GtkTreeViewColumn *idle_column, |
62 *warning_column, | |
5228 | 63 *buddy_icon_column; |
64 | |
5427 | 65 GtkItemFactory *ift; |
5228 | 66 GtkWidget *bpmenu; /**< The buddy pounce menu. */ |
67 | |
68 GtkWidget *bbox; /**< A Button Box. */ | |
69 GtkTooltips *tooltips; /**< Tooltips for the buttons. */ | |
70 | |
71 guint refresh_timer; /**< The timer for refreshing every 30 seconds */ | |
72 | |
73 guint timeout; /**< The timeout for the tooltip. */ | |
7636 | 74 GdkRectangle tip_rect; /**< This is the bounding rectangle of the |
75 cell we're currently hovering over. This is | |
76 used for tooltips. */ | |
77 GdkRectangle contact_rect; /**< This is the bounding rectangle of the contact node | |
78 and its children. This is used for auto-expand on | |
79 mouseover. */ | |
80 GaimBlistNode *mouseover_contact; /**< This is the contact currently mouse-over expanded */ | |
81 | |
5228 | 82 GtkWidget *tipwindow; /**< The window used by the tooltip */ |
83 | |
84 GaimBlistNode *selected_node; /**< The currently selected node */ | |
85 | |
7304 | 86 GdkPixbuf *east, *south; /**< Drop shadow stuff */ |
87 GdkWindow *east_shadow, *south_shadow; /**< Drop shadow stuff */ | |
88 | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
89 } GaimGtkBuddyList; |
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
90 |
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
91 #define GAIM_GTK_BLIST(list) ((GaimGtkBuddyList *)(list)->ui_data) |
5228 | 92 #define GAIM_IS_GTK_BLIST(list) \ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
93 ((list)->ui_ops == gaim_gtk_blist_get_ui_ops()) |
5228 | 94 |
95 /************************************************************************** | |
5422 | 96 * @name GTK+ Buddy List API |
5228 | 97 **************************************************************************/ |
5906 | 98 |
99 /** | |
100 * Initializes the GTK+ blist system. | |
101 */ | |
102 void gaim_gtk_blist_init(void); | |
103 | |
5228 | 104 /** |
105 * Returns the UI operations structure for the buddy list. | |
106 * | |
107 * @return The GTK list operations structure. | |
108 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
109 GaimBlistUiOps *gaim_gtk_blist_get_ui_ops(void); |
5228 | 110 |
111 /** | |
112 * Returns the base image to represent the account, based on the currently selected theme | |
113 * | |
114 * @param account The account. | |
6695 | 115 * |
5228 | 116 * @return The icon |
117 */ | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5427
diff
changeset
|
118 GdkPixbuf *create_prpl_icon(GaimAccount *account); |
5228 | 119 |
120 /** | |
121 * Refreshes all the nodes of the buddy list. | |
122 * This should only be called when something changes to affect most of the nodes (such as a ui preference changing) | |
123 * | |
124 * @param list This is the core list that gets updated from | |
125 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
126 void gaim_gtk_blist_refresh(GaimBuddyList *list); |
5228 | 127 |
128 /** | |
129 * Tells the buddy list to update its toolbar based on the preferences | |
130 * | |
131 */ | |
132 void gaim_gtk_blist_update_toolbar(); | |
133 | |
134 /** | |
135 * Useful for the docklet plugin and also for the win32 tray icon | |
6695 | 136 * This is called when one of those is clicked--it will show/hide the |
137 * buddy list/login window--depending on which is active | |
5228 | 138 */ |
139 void gaim_gtk_blist_docklet_toggle(); | |
140 void gaim_gtk_blist_docklet_add(); | |
141 void gaim_gtk_blist_docklet_remove(); | |
142 void gaim_gtk_blist_update_columns(); | |
5411 | 143 void gaim_gtk_blist_update_refresh_timeout(); |
5228 | 144 |
145 /** | |
146 * Useful for the buddy ticker | |
147 */ | |
5234 | 148 GdkPixbuf *gaim_gtk_blist_get_status_icon(GaimBlistNode *node, |
5228 | 149 GaimStatusIconSize size); |
150 | |
5422 | 151 /************************************************************************** |
152 * @name GTK+ Buddy List sorting functions | |
153 **************************************************************************/ | |
154 | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
155 typedef GtkTreeIter (*gaim_gtk_blist_sort_function)(GaimBlistNode *new, GaimBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur); |
5422 | 156 |
157 extern GSList *gaim_gtk_blist_sort_methods; | |
158 | |
159 struct gaim_gtk_blist_sort_method { | |
5631 | 160 char *id; |
5422 | 161 char *name; |
162 gaim_gtk_blist_sort_function func; | |
163 }; | |
164 | |
165 /** | |
166 * Registers a buddy list sorting method. | |
167 * | |
5631 | 168 * @param id The unique ID of the sorting method |
5422 | 169 * @param name The method's name. |
170 * @param func A pointer to the function. | |
171 * | |
172 */ | |
5631 | 173 void gaim_gtk_blist_sort_method_reg(const char *id, const char *name, gaim_gtk_blist_sort_function func); |
5422 | 174 |
175 /** | |
176 * Unregisters a buddy list sorting method. | |
177 * | |
5631 | 178 * @param id The method's id |
5422 | 179 */ |
5631 | 180 void gaim_gtk_blist_sort_method_unreg(const char *id); |
5422 | 181 |
182 /** | |
183 * Sets a buddy list sorting method. | |
184 * | |
5631 | 185 * @param id The method's id. |
5422 | 186 */ |
5631 | 187 void gaim_gtk_blist_sort_method_set(const char *id); |
5422 | 188 |
189 /** | |
190 * Sets up the programs default sort methods | |
191 */ | |
192 void gaim_gtk_blist_setup_sort_methods(); | |
193 | |
5936
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
194 /** |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
195 * Updates the protocol actions menu on the GTK+ buddy list window. |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
196 */ |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
197 void gaim_gtk_blist_update_protocol_actions(); |
5422 | 198 |
8305
57bdd25752c1
[gaim-migrate @ 9029]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
199 /** |
57bdd25752c1
[gaim-migrate @ 9029]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
200 * Shows the join chat dialog |
57bdd25752c1
[gaim-migrate @ 9029]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
201 */ |
57bdd25752c1
[gaim-migrate @ 9029]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
202 void gaim_gtk_blist_show_join_chat(void); |
5422 | 203 |
5228 | 204 #endif /* _GAIM_GTK_LIST_H_ */ |