Sun, 20 May 2007 06:19:49 +0000
merge of 'b98e72d4089afb8a1879e5fe9627cfb132ee88de'
and 'b2836a24d81e7a1bd1d21b3aea8794b094391344'
| 6846 | 1 | /** |
|
6869
d5cb454deff7
[gaim-migrate @ 7415]
Mark Doliner <markdoliner@pidgin.im>
parents:
6846
diff
changeset
|
2 | * @file buddyicon.h Buddy Icon API |
| 6846 | 3 | * @ingroup core |
| 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. | |
| 6846 | 10 | * |
| 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
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9396
diff
changeset
|
25 | #ifndef _GAIM_BUDDYICON_H_ |
|
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9396
diff
changeset
|
26 | #define _GAIM_BUDDYICON_H_ |
| 6846 | 27 | |
| 28 | typedef struct _GaimBuddyIcon GaimBuddyIcon; | |
| 29 | ||
| 30 | #include "account.h" | |
|
9718
aeee69c6c784
[gaim-migrate @ 10579]
Mark Doliner <markdoliner@pidgin.im>
parents:
9713
diff
changeset
|
31 | #include "blist.h" |
| 10483 | 32 | #include "prpl.h" |
| 6846 | 33 | |
| 34 | struct _GaimBuddyIcon | |
| 35 | { | |
| 36 | GaimAccount *account; /**< The account the user is on. */ | |
| 37 | char *username; /**< The username the icon belongs to. */ | |
| 38 | ||
| 39 | void *data; /**< The buddy icon data. */ | |
| 40 | size_t len; /**< The length of the buddy icon data. */ | |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
41 | char *path; /**< The buddy icon's non-cached path. */ |
| 6846 | 42 | |
| 43 | int ref_count; /**< The buddy icon reference count. */ | |
| 44 | }; | |
| 45 | ||
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
12323
diff
changeset
|
46 | #ifdef __cplusplus |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
12323
diff
changeset
|
47 | extern "C" { |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
12323
diff
changeset
|
48 | #endif |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
12323
diff
changeset
|
49 | |
| 6846 | 50 | /**************************************************************************/ |
| 51 | /** @name Buddy Icon API */ | |
| 52 | /**************************************************************************/ | |
| 53 | /*@{*/ | |
| 54 | ||
| 55 | /** | |
| 56 | * Creates a new buddy icon structure. | |
| 57 | * | |
| 58 | * @param account The account the user is on. | |
| 59 | * @param username The username the icon belongs to. | |
| 60 | * @param icon_data The buddy icon data. | |
| 61 | * @param icon_len The buddy icon length. | |
| 62 | * | |
| 63 | * @return The buddy icon structure. | |
| 64 | */ | |
| 65 | GaimBuddyIcon *gaim_buddy_icon_new(GaimAccount *account, const char *username, | |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
66 | void *icon_data, size_t icon_len); |
| 6846 | 67 | |
| 68 | /** | |
| 69 | * Destroys a buddy icon structure. | |
| 70 | * | |
| 71 | * If the buddy icon's reference count is greater than 1, this will | |
| 72 | * just decrease the reference count and return. | |
| 73 | * | |
| 74 | * @param icon The buddy icon structure to destroy. | |
| 75 | */ | |
| 76 | void gaim_buddy_icon_destroy(GaimBuddyIcon *icon); | |
| 77 | ||
| 78 | /** | |
| 79 | * Increments the reference count on a buddy icon. | |
| 80 | * | |
| 81 | * @param icon The buddy icon. | |
| 82 | * | |
| 83 | * @return @a icon. | |
| 84 | */ | |
| 85 | GaimBuddyIcon *gaim_buddy_icon_ref(GaimBuddyIcon *icon); | |
| 86 | ||
| 87 | /** | |
| 88 | * Decrements the reference count on a buddy icon. | |
| 89 | * | |
| 90 | * If the reference count reaches 0, the icon will be destroyed. | |
| 91 | * | |
| 92 | * @param icon The buddy icon. | |
| 93 | * | |
| 94 | * @return @a icon, or @c NULL if the reference count reached 0. | |
| 95 | */ | |
| 96 | GaimBuddyIcon *gaim_buddy_icon_unref(GaimBuddyIcon *icon); | |
| 97 | ||
| 98 | /** | |
| 99 | * Updates every instance of this icon. | |
| 100 | * | |
| 101 | * @param icon The buddy icon. | |
| 102 | */ | |
| 103 | void gaim_buddy_icon_update(GaimBuddyIcon *icon); | |
| 104 | ||
| 105 | /** | |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
106 | * Caches a buddy icon associated with a specific buddy to disk. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
107 | * |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
108 | * @param icon The buddy icon. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
109 | * @param buddy The buddy that this icon belongs to. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
110 | */ |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
111 | void gaim_buddy_icon_cache(GaimBuddyIcon *icon, GaimBuddy *buddy); |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
112 | |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
113 | /** |
|
11040
37e247d18e78
[gaim-migrate @ 12940]
Richard Laager <rlaager@pidgin.im>
parents:
10953
diff
changeset
|
114 | * Removes cached buddy icon for a specific buddy. |
|
37e247d18e78
[gaim-migrate @ 12940]
Richard Laager <rlaager@pidgin.im>
parents:
10953
diff
changeset
|
115 | * |
|
37e247d18e78
[gaim-migrate @ 12940]
Richard Laager <rlaager@pidgin.im>
parents:
10953
diff
changeset
|
116 | * @param buddy The buddy for which to remove the cached icon. |
|
37e247d18e78
[gaim-migrate @ 12940]
Richard Laager <rlaager@pidgin.im>
parents:
10953
diff
changeset
|
117 | */ |
|
37e247d18e78
[gaim-migrate @ 12940]
Richard Laager <rlaager@pidgin.im>
parents:
10953
diff
changeset
|
118 | void gaim_buddy_icon_uncache(GaimBuddy *buddy); |
|
37e247d18e78
[gaim-migrate @ 12940]
Richard Laager <rlaager@pidgin.im>
parents:
10953
diff
changeset
|
119 | |
|
37e247d18e78
[gaim-migrate @ 12940]
Richard Laager <rlaager@pidgin.im>
parents:
10953
diff
changeset
|
120 | /** |
| 6846 | 121 | * Sets the buddy icon's account. |
| 122 | * | |
| 123 | * @param icon The buddy icon. | |
| 124 | * @param account The account. | |
| 125 | */ | |
| 126 | void gaim_buddy_icon_set_account(GaimBuddyIcon *icon, GaimAccount *account); | |
| 127 | ||
| 128 | /** | |
| 129 | * Sets the buddy icon's username. | |
| 130 | * | |
| 131 | * @param icon The buddy icon. | |
| 132 | * @param username The username. | |
| 133 | */ | |
| 134 | void gaim_buddy_icon_set_username(GaimBuddyIcon *icon, const char *username); | |
| 135 | ||
| 136 | /** | |
| 137 | * Sets the buddy icon's icon data. | |
| 138 | * | |
| 139 | * @param icon The buddy icon. | |
| 140 | * @param data The buddy icon data. | |
| 141 | * @param len The length of the icon data. | |
| 142 | */ | |
| 143 | void gaim_buddy_icon_set_data(GaimBuddyIcon *icon, void *data, size_t len); | |
| 144 | ||
| 145 | /** | |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
146 | * Sets the buddy icon's path. |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
147 | * |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
148 | * @param icon The buddy icon. |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
149 | * @param path The buddy icon's non-cached path. |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
150 | */ |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
151 | void gaim_buddy_icon_set_path(GaimBuddyIcon *icon, const gchar *path); |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
152 | |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
153 | /** |
| 6846 | 154 | * Returns the buddy icon's account. |
| 155 | * | |
| 156 | * @param icon The buddy icon. | |
| 157 | * | |
| 158 | * @return The account. | |
| 159 | */ | |
| 160 | GaimAccount *gaim_buddy_icon_get_account(const GaimBuddyIcon *icon); | |
| 161 | ||
| 162 | /** | |
| 163 | * Returns the buddy icon's username. | |
| 164 | * | |
| 165 | * @param icon The buddy icon. | |
| 166 | * | |
| 167 | * @return The username. | |
| 168 | */ | |
| 169 | const char *gaim_buddy_icon_get_username(const GaimBuddyIcon *icon); | |
| 170 | ||
| 171 | /** | |
| 172 | * Returns the buddy icon's data. | |
| 173 | * | |
| 174 | * @param icon The buddy icon. | |
| 175 | * @param len The returned icon length. | |
| 176 | * | |
| 177 | * @return The icon data. | |
| 178 | */ | |
|
11137
cf40226ddff7
[gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents:
11040
diff
changeset
|
179 | const guchar *gaim_buddy_icon_get_data(const GaimBuddyIcon *icon, size_t *len); |
| 6846 | 180 | |
|
10953
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
181 | /** |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
182 | * Returns the buddy icon's path. |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
183 | * |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
184 | * @param icon The buddy icon. |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
185 | * |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
186 | * @preturn The buddy icon's non-cached path. |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
187 | */ |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
188 | const gchar *gaim_buddy_icon_get_path(GaimBuddyIcon *icon); |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
189 | |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
190 | /** |
|
10953
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
191 | * Returns an extension corresponding to the buddy icon's file type. |
|
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
192 | * |
|
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
193 | * @param icon The buddy icon. |
|
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
194 | * |
|
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
195 | * @return The icon's extension. |
|
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
196 | */ |
|
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
197 | const char *gaim_buddy_icon_get_type(const GaimBuddyIcon *icon); |
|
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
198 | |
| 6846 | 199 | /*@}*/ |
| 200 | ||
| 201 | /**************************************************************************/ | |
| 202 | /** @name Buddy Icon Subsystem API */ | |
| 203 | /**************************************************************************/ | |
| 204 | /*@{*/ | |
| 205 | ||
| 206 | /** | |
| 207 | * Sets a buddy icon for a user. | |
| 208 | * | |
| 209 | * @param account The account the user is on. | |
| 210 | * @param username The username of the user. | |
| 211 | * @param icon_data The icon data. | |
| 212 | * @param icon_len The length of the icon data. | |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
213 | * |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
214 | * @return The buddy icon set, or NULL if no icon was set. |
| 6846 | 215 | */ |
| 216 | void gaim_buddy_icons_set_for_user(GaimAccount *account, const char *username, | |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
217 | void *icon_data, size_t icon_len); |
| 6846 | 218 | |
| 219 | /** | |
| 220 | * Returns the buddy icon information for a user. | |
| 221 | * | |
| 222 | * @param account The account the user is on. | |
| 223 | * @param username The username of the user. | |
| 224 | * | |
| 225 | * @return The icon data if found, or @c NULL if not found. | |
| 226 | */ | |
| 9396 | 227 | GaimBuddyIcon *gaim_buddy_icons_find(GaimAccount *account, |
| 6846 | 228 | const char *username); |
| 229 | ||
| 230 | /** | |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
231 | * Sets whether or not buddy icon caching is enabled. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
232 | * |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
233 | * @param caching TRUE of buddy icon caching should be enabled, or |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
234 | * FALSE otherwise. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
235 | */ |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
236 | void gaim_buddy_icons_set_caching(gboolean caching); |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
237 | |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
238 | /** |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
239 | * Returns whether or not buddy icon caching should be enabled. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
240 | * |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
241 | * The default is TRUE, unless otherwise specified by |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
242 | * gaim_buddy_icons_set_caching(). |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
243 | * |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
244 | * @return TRUE if buddy icon caching is enabled, or FALSE otherwise. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
245 | */ |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
246 | gboolean gaim_buddy_icons_is_caching(void); |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
247 | |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
248 | /** |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
249 | * Sets the directory used to store buddy icon cache files. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
250 | * |
|
7114
6e5e4e674496
[gaim-migrate @ 7681]
Christian Hammond <chipx86@chipx86.com>
parents:
6886
diff
changeset
|
251 | * @param cache_dir The directory to store buddy icon cache files to. |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
252 | */ |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
253 | void gaim_buddy_icons_set_cache_dir(const char *cache_dir); |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
254 | |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
255 | /** |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
256 | * Returns the directory used to store buddy icon cache files. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
257 | * |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
258 | * The default directory is GAIMDIR/icons, unless otherwise specified |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
259 | * by gaim_buddy_icons_set_cache_dir(). |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
260 | * |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
261 | * @return The directory to store buddy icon cache files to. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
262 | */ |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
263 | const char *gaim_buddy_icons_get_cache_dir(void); |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
264 | |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
265 | /** |
|
11303
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
266 | * Takes a buddy icon and returns a full path. |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
267 | * |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
268 | * If @a icon is a full path to an existing file, a copy of |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
269 | * @a icon is returned. Otherwise, a newly allocated string |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
270 | * consiting of gaim_buddy_icons_get_cache_dir() + @a icon is |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
271 | * returned. |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
272 | * |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
273 | * @return The full path for an icon. |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
274 | */ |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
275 | char *gaim_buddy_icons_get_full_path(const char *icon); |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
276 | |
|
448b8bae1ca7
[gaim-migrate @ 13503]
Richard Laager <rlaager@pidgin.im>
parents:
11137
diff
changeset
|
277 | /** |
| 6846 | 278 | * Returns the buddy icon subsystem handle. |
| 279 | * | |
| 280 | * @return The subsystem handle. | |
| 281 | */ | |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11303
diff
changeset
|
282 | void *gaim_buddy_icons_get_handle(void); |
| 6846 | 283 | |
| 284 | /** | |
| 285 | * Initializes the buddy icon subsystem. | |
| 286 | */ | |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11303
diff
changeset
|
287 | void gaim_buddy_icons_init(void); |
| 6846 | 288 | |
| 289 | /** | |
| 290 | * Uninitializes the buddy icon subsystem. | |
| 291 | */ | |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11303
diff
changeset
|
292 | void gaim_buddy_icons_uninit(void); |
| 6846 | 293 | |
| 294 | /*@}*/ | |
| 295 | ||
| 10483 | 296 | /**************************************************************************/ |
| 297 | /** @name Buddy Icon Helper API */ | |
| 298 | /**************************************************************************/ | |
| 299 | /*@{*/ | |
| 300 | ||
| 301 | /** | |
| 302 | * Gets display size for a buddy icon | |
| 303 | */ | |
| 304 | void gaim_buddy_icon_get_scale_size(GaimBuddyIconSpec *spec, int *width, int *height); | |
| 305 | ||
| 306 | /*@}*/ | |
| 307 | ||
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
12323
diff
changeset
|
308 | #ifdef __cplusplus |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
12323
diff
changeset
|
309 | } |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
12323
diff
changeset
|
310 | #endif |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
12323
diff
changeset
|
311 | |
|
9713
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9396
diff
changeset
|
312 | #endif /* _GAIM_BUDDYICON_H_ */ |