Mercurial > pidgin
annotate src/gtkblist.h @ 5905:dbe2a2174be9
[gaim-migrate @ 6337]
Some stuff from Robot101. It puts some docklet functionality back in,
fixes a bug where connected accounts was being listed as connecting accounts,
and something I'm not allowed to say, because it's just that cool.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 16 Jun 2003 04:15:35 +0000 |
parents | 059d95c67cda |
children | 390d32a6b130 |
rev | line source |
---|---|
5228 | 1 /** |
5248 | 2 * @file gtkblist.h GTK+ Buddy List API |
5228 | 3 * @ingroup gtkui |
4 * | |
5 * gaim | |
6 * | |
7 * Copyright (C) 2002-2003, Sean Egan <sean.egan@binghamton.edu> | |
8 * | |
9 * This program is free software; you can redistribute it and/or modify | |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 */ | |
23 | |
24 #ifndef _GAIM_GTK_LIST_H_ | |
25 #define _GAIM_GTK_LIST_H_ | |
26 | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5631
diff
changeset
|
27 #include "blist.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5631
diff
changeset
|
28 |
5228 | 29 enum { |
30 STATUS_ICON_COLUMN, | |
31 STATUS_ICON_VISIBLE_COLUMN, | |
32 NAME_COLUMN, | |
33 WARNING_COLUMN, | |
34 IDLE_COLUMN, | |
35 BUDDY_ICON_COLUMN, | |
36 NODE_COLUMN, | |
37 BLIST_COLUMNS | |
38 }; | |
39 | |
40 typedef enum { | |
41 GAIM_STATUS_ICON_LARGE, | |
42 GAIM_STATUS_ICON_SMALL | |
43 } GaimStatusIconSize; | |
44 /************************************************************************** | |
45 * @name Structures | |
46 **************************************************************************/ | |
47 /** | |
48 * Like, everything you need to know about the gtk buddy list | |
49 */ | |
50 struct gaim_gtk_buddy_list { | |
51 GtkWidget *window; | |
52 GtkWidget *vbox; /**< This is the vbox that everything gets packed into. Your plugin might | |
53 want to pack something in it itself. Go, plugins! */ | |
54 | |
55 GtkWidget *treeview; /**< It's a treeview... d'uh. */ | |
56 GtkTreeStore *treemodel; /**< This is the treemodel. */ | |
57 GtkTreeViewColumn *idle_column, | |
58 *warning_column, | |
59 *buddy_icon_column; | |
60 | |
5427 | 61 GtkItemFactory *ift; |
5228 | 62 GtkWidget *bpmenu; /**< The buddy pounce menu. */ |
63 | |
64 GtkWidget *bbox; /**< A Button Box. */ | |
65 GtkTooltips *tooltips; /**< Tooltips for the buttons. */ | |
66 | |
67 guint refresh_timer; /**< The timer for refreshing every 30 seconds */ | |
68 | |
69 guint timeout; /**< The timeout for the tooltip. */ | |
70 GdkRectangle rect; /**< This is the bounding rectangle of the | |
71 cell we're currently hovering over. This is | |
72 used for tooltips. */ | |
73 GtkWidget *tipwindow; /**< The window used by the tooltip */ | |
74 | |
75 GaimBlistNode *selected_node; /**< The currently selected node */ | |
76 }; | |
77 | |
78 #define GAIM_GTK_BLIST(list) ((struct gaim_gtk_buddy_list *)(list)->ui_data) | |
79 #define GAIM_IS_GTK_BLIST(list) \ | |
80 ((list)->ui_ops == gaim_get_gtk_blist_ui_ops()) | |
81 | |
82 /************************************************************************** | |
5422 | 83 * @name GTK+ Buddy List API |
5228 | 84 **************************************************************************/ |
85 /** | |
86 * Returns the UI operations structure for the buddy list. | |
87 * | |
88 * @return The GTK list operations structure. | |
89 */ | |
90 struct gaim_blist_ui_ops *gaim_get_gtk_blist_ui_ops(void); | |
91 | |
92 /** | |
93 * Returns the base image to represent the account, based on the currently selected theme | |
94 * | |
95 * @param account The account. | |
96 * | |
97 * @return The icon | |
98 */ | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5427
diff
changeset
|
99 GdkPixbuf *create_prpl_icon(GaimAccount *account); |
5228 | 100 |
101 /** | |
102 * Refreshes all the nodes of the buddy list. | |
103 * This should only be called when something changes to affect most of the nodes (such as a ui preference changing) | |
104 * | |
105 * @param list This is the core list that gets updated from | |
106 */ | |
107 void gaim_gtk_blist_refresh(struct gaim_buddy_list *list); | |
108 | |
109 /** | |
110 * Tells the buddy list to update its toolbar based on the preferences | |
111 * | |
112 */ | |
113 void gaim_gtk_blist_update_toolbar(); | |
114 | |
115 /** | |
116 * Useful for the docklet plugin and also for the win32 tray icon | |
117 * This is called when one of those is clicked--it will show/hide the | |
118 * buddy list/login window--depending on which is active | |
119 */ | |
120 void gaim_gtk_blist_docklet_toggle(); | |
121 void gaim_gtk_blist_docklet_add(); | |
122 void gaim_gtk_blist_docklet_remove(); | |
123 void gaim_gtk_blist_update_columns(); | |
5411 | 124 void gaim_gtk_blist_update_refresh_timeout(); |
5228 | 125 |
126 /** | |
127 * Useful for the buddy ticker | |
128 */ | |
5234 | 129 GdkPixbuf *gaim_gtk_blist_get_status_icon(GaimBlistNode *node, |
5228 | 130 GaimStatusIconSize size); |
131 | |
5422 | 132 /************************************************************************** |
133 * @name GTK+ Buddy List sorting functions | |
134 **************************************************************************/ | |
135 | |
136 typedef GtkTreeIter (*gaim_gtk_blist_sort_function)(GaimBlistNode *new, struct gaim_buddy_list *blist, GtkTreeIter group, GtkTreeIter *cur); | |
137 | |
138 extern GSList *gaim_gtk_blist_sort_methods; | |
139 | |
140 struct gaim_gtk_blist_sort_method { | |
5631 | 141 char *id; |
5422 | 142 char *name; |
143 gaim_gtk_blist_sort_function func; | |
144 }; | |
145 | |
146 /** | |
147 * Registers a buddy list sorting method. | |
148 * | |
5631 | 149 * @param id The unique ID of the sorting method |
5422 | 150 * @param name The method's name. |
151 * @param func A pointer to the function. | |
152 * | |
153 */ | |
5631 | 154 void gaim_gtk_blist_sort_method_reg(const char *id, const char *name, gaim_gtk_blist_sort_function func); |
5422 | 155 |
156 /** | |
157 * Unregisters a buddy list sorting method. | |
158 * | |
5631 | 159 * @param id The method's id |
5422 | 160 */ |
5631 | 161 void gaim_gtk_blist_sort_method_unreg(const char *id); |
5422 | 162 |
163 /** | |
164 * Sets a buddy list sorting method. | |
165 * | |
5631 | 166 * @param id The method's id. |
5422 | 167 */ |
5631 | 168 void gaim_gtk_blist_sort_method_set(const char *id); |
5422 | 169 |
170 /** | |
171 * Sets up the programs default sort methods | |
172 */ | |
173 void gaim_gtk_blist_setup_sort_methods(); | |
174 | |
175 | |
176 | |
5228 | 177 #endif /* _GAIM_GTK_LIST_H_ */ |