Mercurial > pidgin
annotate src/gtkblist.h @ 7606:08c9d0dcf906
[gaim-migrate @ 8229]
" Some things allocated with g_malloc() were being
free()'d instead of g_free()'d
This patch fixes the ones I managed to find." --Stu Tomlinson (nosnilmot)
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sun, 23 Nov 2003 15:32:25 +0000 |
parents | 52cf473a0103 |
children | 01c1b3ea70c6 |
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> | |
5906 | 8 * |
5228 | 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 | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
43 |
5228 | 44 } GaimStatusIconSize; |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
45 |
5228 | 46 /************************************************************************** |
47 * @name Structures | |
48 **************************************************************************/ | |
49 /** | |
50 * Like, everything you need to know about the gtk buddy list | |
51 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
52 typedef struct { |
5228 | 53 GtkWidget *window; |
54 GtkWidget *vbox; /**< This is the vbox that everything gets packed into. Your plugin might | |
55 want to pack something in it itself. Go, plugins! */ | |
56 | |
57 GtkWidget *treeview; /**< It's a treeview... d'uh. */ | |
58 GtkTreeStore *treemodel; /**< This is the treemodel. */ | |
6695 | 59 GtkTreeViewColumn *idle_column, |
60 *warning_column, | |
5228 | 61 *buddy_icon_column; |
62 | |
5427 | 63 GtkItemFactory *ift; |
5228 | 64 GtkWidget *bpmenu; /**< The buddy pounce menu. */ |
65 | |
66 GtkWidget *bbox; /**< A Button Box. */ | |
67 GtkTooltips *tooltips; /**< Tooltips for the buttons. */ | |
68 | |
69 guint refresh_timer; /**< The timer for refreshing every 30 seconds */ | |
70 | |
71 guint timeout; /**< The timeout for the tooltip. */ | |
72 GdkRectangle rect; /**< This is the bounding rectangle of the | |
6695 | 73 cell we're currently hovering over. This is |
5228 | 74 used for tooltips. */ |
75 GtkWidget *tipwindow; /**< The window used by the tooltip */ | |
76 | |
77 GaimBlistNode *selected_node; /**< The currently selected node */ | |
78 | |
7304 | 79 GdkPixbuf *east, *south; /**< Drop shadow stuff */ |
80 GdkWindow *east_shadow, *south_shadow; /**< Drop shadow stuff */ | |
81 | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
82 } GaimGtkBuddyList; |
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
83 |
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
84 #define GAIM_GTK_BLIST(list) ((GaimGtkBuddyList *)(list)->ui_data) |
5228 | 85 #define GAIM_IS_GTK_BLIST(list) \ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
86 ((list)->ui_ops == gaim_gtk_blist_get_ui_ops()) |
5228 | 87 |
88 /************************************************************************** | |
5422 | 89 * @name GTK+ Buddy List API |
5228 | 90 **************************************************************************/ |
5906 | 91 |
92 /** | |
93 * Initializes the GTK+ blist system. | |
94 */ | |
95 void gaim_gtk_blist_init(void); | |
96 | |
5228 | 97 /** |
98 * Returns the UI operations structure for the buddy list. | |
99 * | |
100 * @return The GTK list operations structure. | |
101 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
102 GaimBlistUiOps *gaim_gtk_blist_get_ui_ops(void); |
5228 | 103 |
104 /** | |
105 * Returns the base image to represent the account, based on the currently selected theme | |
106 * | |
107 * @param account The account. | |
6695 | 108 * |
5228 | 109 * @return The icon |
110 */ | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5427
diff
changeset
|
111 GdkPixbuf *create_prpl_icon(GaimAccount *account); |
5228 | 112 |
113 /** | |
114 * Refreshes all the nodes of the buddy list. | |
115 * This should only be called when something changes to affect most of the nodes (such as a ui preference changing) | |
116 * | |
117 * @param list This is the core list that gets updated from | |
118 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
119 void gaim_gtk_blist_refresh(GaimBuddyList *list); |
5228 | 120 |
121 /** | |
122 * Tells the buddy list to update its toolbar based on the preferences | |
123 * | |
124 */ | |
125 void gaim_gtk_blist_update_toolbar(); | |
126 | |
127 /** | |
128 * Useful for the docklet plugin and also for the win32 tray icon | |
6695 | 129 * This is called when one of those is clicked--it will show/hide the |
130 * buddy list/login window--depending on which is active | |
5228 | 131 */ |
132 void gaim_gtk_blist_docklet_toggle(); | |
133 void gaim_gtk_blist_docklet_add(); | |
134 void gaim_gtk_blist_docklet_remove(); | |
135 void gaim_gtk_blist_update_columns(); | |
5411 | 136 void gaim_gtk_blist_update_refresh_timeout(); |
5228 | 137 |
138 /** | |
139 * Useful for the buddy ticker | |
140 */ | |
5234 | 141 GdkPixbuf *gaim_gtk_blist_get_status_icon(GaimBlistNode *node, |
5228 | 142 GaimStatusIconSize size); |
143 | |
5422 | 144 /************************************************************************** |
145 * @name GTK+ Buddy List sorting functions | |
146 **************************************************************************/ | |
147 | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
148 typedef GtkTreeIter (*gaim_gtk_blist_sort_function)(GaimBlistNode *new, GaimBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur); |
5422 | 149 |
150 extern GSList *gaim_gtk_blist_sort_methods; | |
151 | |
152 struct gaim_gtk_blist_sort_method { | |
5631 | 153 char *id; |
5422 | 154 char *name; |
155 gaim_gtk_blist_sort_function func; | |
156 }; | |
157 | |
158 /** | |
159 * Registers a buddy list sorting method. | |
160 * | |
5631 | 161 * @param id The unique ID of the sorting method |
5422 | 162 * @param name The method's name. |
163 * @param func A pointer to the function. | |
164 * | |
165 */ | |
5631 | 166 void gaim_gtk_blist_sort_method_reg(const char *id, const char *name, gaim_gtk_blist_sort_function func); |
5422 | 167 |
168 /** | |
169 * Unregisters a buddy list sorting method. | |
170 * | |
5631 | 171 * @param id The method's id |
5422 | 172 */ |
5631 | 173 void gaim_gtk_blist_sort_method_unreg(const char *id); |
5422 | 174 |
175 /** | |
176 * Sets a buddy list sorting method. | |
177 * | |
5631 | 178 * @param id The method's id. |
5422 | 179 */ |
5631 | 180 void gaim_gtk_blist_sort_method_set(const char *id); |
5422 | 181 |
182 /** | |
183 * Sets up the programs default sort methods | |
184 */ | |
185 void gaim_gtk_blist_setup_sort_methods(); | |
186 | |
5936
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
187 /** |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
188 * Updates the protocol actions menu on the GTK+ buddy list window. |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
189 */ |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
190 void gaim_gtk_blist_update_protocol_actions(); |
5422 | 191 |
192 | |
5228 | 193 #endif /* _GAIM_GTK_LIST_H_ */ |