Fri, 19 Jul 2013 13:55:59 +0530
Started GObjectification of PurpleBuddyIcon.
Removed purple_buddy_icon_ref() and purple_buddy_icon_unref()
| 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 |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* purple |
| 6846 | 7 | * |
| 15884 | 8 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
| 6846 | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18101
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 6846 | 25 | */ |
| 15884 | 26 | #ifndef _PURPLE_BUDDYICON_H_ |
| 27 | #define _PURPLE_BUDDYICON_H_ | |
| 6846 | 28 | |
|
34829
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
29 | #define PURPLE_TYPE_BUDDY_ICON (purple_buddy_icon_get_type()) |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
30 | #define PURPLE_BUDDY_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_BUDDY_ICON, PurpleBuddyIcon)) |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
31 | #define PURPLE_BUDDY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_BUDDY_ICON, PurpleBuddyIconClass)) |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
32 | #define PURPLE_IS_BUDDY_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_BUDDY_ICON)) |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
33 | #define PURPLE_IS_BUDDY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_BUDDY_ICON)) |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
34 | #define PURPLE_BUDDY_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_BUDDY_ICON, PurpleBuddyIconClass)) |
|
34768
d193657a4b37
Added GBoxed wrapping to PurpleBuddyIcon
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
35 | |
|
34829
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
36 | /** @copydoc _PurpleBuddyIcon */ |
| 15884 | 37 | typedef struct _PurpleBuddyIcon PurpleBuddyIcon; |
|
34829
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
38 | /** @copydoc _PurpleBuddyIconClass */ |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
39 | typedef struct _PurpleBuddyIconClass PurpleBuddyIconClass; |
| 6846 | 40 | |
| 41 | #include "account.h" | |
|
34706
02cb08146888
Renamed blist.[ch] to buddylist.[ch]
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
42 | #include "buddylist.h" |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
43 | #include "imgstore.h" |
| 10483 | 44 | #include "prpl.h" |
|
18101
3ce21b5a182c
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents:
16900
diff
changeset
|
45 | #include "util.h" |
| 6846 | 46 | |
|
34829
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
47 | /** An object representing a buddy icon for a particular user on a particular |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
48 | * #PurpleAccount. Use g_object_ref() and g_object_unref() to take and release |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
49 | * references. |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
50 | */ |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
51 | struct _PurpleBuddyIcon |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
52 | { |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
53 | /*< private >*/ |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
54 | GObject gparent; |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
55 | }; |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
56 | |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
57 | /** |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
58 | * The base class for all #PurpleBuddyIcon's. |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
59 | */ |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
60 | struct _PurpleBuddyIconClass { |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
61 | /*< private >*/ |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
62 | GObjectClass parent_class; |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
63 | |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
64 | void (*_purple_reserved1)(void); |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
65 | void (*_purple_reserved2)(void); |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
66 | void (*_purple_reserved3)(void); |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
67 | void (*_purple_reserved4)(void); |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
68 | }; |
|
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
69 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32305
diff
changeset
|
70 | G_BEGIN_DECLS |
|
16421
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
71 | |
| 6846 | 72 | /**************************************************************************/ |
| 73 | /** @name Buddy Icon API */ | |
| 74 | /**************************************************************************/ | |
| 75 | /*@{*/ | |
| 76 | ||
| 77 | /** | |
|
34829
1feefa206b17
Started GObjectification of PurpleBuddyIcon.
Ankit Vani <a@nevitus.org>
parents:
34796
diff
changeset
|
78 | * Returns the GType for the PurpleBuddyIcon object. |
|
34768
d193657a4b37
Added GBoxed wrapping to PurpleBuddyIcon
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
79 | */ |
|
d193657a4b37
Added GBoxed wrapping to PurpleBuddyIcon
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
80 | GType purple_buddy_icon_get_type(void); |
|
d193657a4b37
Added GBoxed wrapping to PurpleBuddyIcon
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
81 | |
|
d193657a4b37
Added GBoxed wrapping to PurpleBuddyIcon
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
82 | /** |
|
22763
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
20147
diff
changeset
|
83 | * Creates a new buddy icon structure and populates it. |
|
16421
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
84 | * |
| 33663 | 85 | * If an icon for this account+username already exists, you'll get a reference |
| 86 | * to that structure, which will have been updated with the data supplied. | |
| 6846 | 87 | * |
| 88 | * @param account The account the user is on. | |
| 89 | * @param username The username the icon belongs to. | |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
90 | * @param icon_data The buddy icon data. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
91 | * @param icon_len The buddy icon length. |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
92 | * @param checksum A protocol checksum from the prpl or @c NULL. |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
93 | * |
|
16900
e9f12eb06c5b
Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@pidgin.im>
parents:
16677
diff
changeset
|
94 | * @return The buddy icon structure, with a reference for the caller. |
| 6846 | 95 | */ |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
96 | PurpleBuddyIcon *purple_buddy_icon_new(PurpleAccount *account, const char *username, |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
97 | void *icon_data, size_t icon_len, |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
98 | const char *checksum); |
| 6846 | 99 | |
| 100 | /** | |
| 101 | * Updates every instance of this icon. | |
| 102 | * | |
| 103 | * @param icon The buddy icon. | |
| 104 | */ | |
| 15884 | 105 | void purple_buddy_icon_update(PurpleBuddyIcon *icon); |
| 6846 | 106 | |
| 107 | /** | |
|
16539
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
108 | * Sets the buddy icon's data. |
| 6846 | 109 | * |
| 110 | * @param icon The buddy icon. | |
|
16539
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
111 | * @param data The buddy icon data, which the buddy icon code |
|
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
112 | * takes ownership of and will free. |
|
16421
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
113 | * @param len The length of the data in @a data. |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
114 | * @param checksum A protocol checksum from the prpl or @c NULL. |
| 6846 | 115 | */ |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
116 | void |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
117 | purple_buddy_icon_set_data(PurpleBuddyIcon *icon, guchar *data, |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
118 | size_t len, const char *checksum); |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
119 | |
|
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
120 | /** |
| 6846 | 121 | * Returns the buddy icon's account. |
| 122 | * | |
| 123 | * @param icon The buddy icon. | |
| 124 | * | |
| 125 | * @return The account. | |
| 126 | */ | |
| 15884 | 127 | PurpleAccount *purple_buddy_icon_get_account(const PurpleBuddyIcon *icon); |
| 6846 | 128 | |
| 129 | /** | |
| 130 | * Returns the buddy icon's username. | |
| 131 | * | |
| 132 | * @param icon The buddy icon. | |
| 133 | * | |
| 134 | * @return The username. | |
| 135 | */ | |
| 15884 | 136 | const char *purple_buddy_icon_get_username(const PurpleBuddyIcon *icon); |
| 6846 | 137 | |
| 138 | /** | |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
139 | * Returns the buddy icon's checksum. |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
140 | * |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
141 | * This function is really only for prpl use. |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
142 | * |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
143 | * @param icon The buddy icon. |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
144 | * |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
145 | * @return The checksum. |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
146 | */ |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
147 | const char *purple_buddy_icon_get_checksum(const PurpleBuddyIcon *icon); |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
148 | |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
149 | /** |
| 6846 | 150 | * Returns the buddy icon's data. |
| 151 | * | |
| 152 | * @param icon The buddy icon. | |
|
16421
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
153 | * @param len If not @c NULL, the length of the icon data returned will be |
|
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
154 | * set in the location pointed to by this. |
| 6846 | 155 | * |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
156 | * @return A pointer to the icon data. |
| 6846 | 157 | */ |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
158 | gconstpointer purple_buddy_icon_get_data(const PurpleBuddyIcon *icon, size_t *len); |
| 6846 | 159 | |
|
10953
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
160 | /** |
|
16421
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
161 | * Returns an extension corresponding to the buddy icon's file type. |
|
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
162 | * |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
14254
diff
changeset
|
163 | * @param icon The buddy icon. |
|
15997
ff97c5f69196
A little doxygen love and some tiny gaim->purpleisms
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
164 | * |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
165 | * @return The icon's extension, "icon" if unknown, or @c NULL if |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
166 | * the image data has disappeared. |
|
10953
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
167 | */ |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
168 | const char *purple_buddy_icon_get_extension(const PurpleBuddyIcon *icon); |
|
10953
e5987ea70985
[gaim-migrate @ 12753]
Richard Laager <rlaager@pidgin.im>
parents:
10483
diff
changeset
|
169 | |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
170 | /** |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
171 | * Returns a full path to an icon. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
172 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
173 | * If the icon has data and the file exists in the cache, this will return |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
174 | * a full path to the cache file. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
175 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
176 | * In general, it is not appropriate to be poking in the icon cache |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
177 | * directly. If you find yourself wanting to use this function, think |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
178 | * very long and hard about it, and then don't. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
179 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
180 | * @param icon The buddy icon |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
181 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
182 | * @return A full path to the file, or @c NULL under various conditions. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
183 | */ |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
184 | char *purple_buddy_icon_get_full_path(PurpleBuddyIcon *icon); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
185 | |
| 6846 | 186 | /*@}*/ |
| 187 | ||
| 188 | /**************************************************************************/ | |
| 189 | /** @name Buddy Icon Subsystem API */ | |
| 190 | /**************************************************************************/ | |
| 191 | /*@{*/ | |
| 192 | ||
| 193 | /** | |
| 194 | * Sets a buddy icon for a user. | |
| 195 | * | |
| 196 | * @param account The account the user is on. | |
| 197 | * @param username The username of the user. | |
|
16539
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
198 | * @param icon_data The buddy icon data, which the buddy icon code |
|
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
199 | * takes ownership of and will free. |
| 6846 | 200 | * @param icon_len The length of the icon data. |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
201 | * @param checksum A protocol checksum from the prpl or @c NULL. |
| 6846 | 202 | */ |
|
16421
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
203 | void |
|
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
204 | purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username, |
|
16534
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
205 | void *icon_data, size_t icon_len, |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
206 | const char *checksum); |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
207 | |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
208 | /** |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
209 | * Returns the checksum for the buddy icon of a specified buddy. |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
210 | * |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
211 | * This avoids loading the icon image data from the cache if it's |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
212 | * not already loaded for some other reason. |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
213 | * |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
214 | * @param buddy The buddy |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
215 | * |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
216 | * @return The checksum. |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
217 | */ |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
218 | const char * |
|
2ab9e23f99d9
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
219 | purple_buddy_icons_get_checksum_for_user(PurpleBuddy *buddy); |
| 6846 | 220 | |
| 221 | /** | |
| 222 | * Returns the buddy icon information for a user. | |
| 223 | * | |
| 224 | * @param account The account the user is on. | |
| 225 | * @param username The username of the user. | |
| 226 | * | |
|
16900
e9f12eb06c5b
Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@pidgin.im>
parents:
16677
diff
changeset
|
227 | * @return The icon (with a reference for the caller) if found, or @c NULL if |
|
e9f12eb06c5b
Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@pidgin.im>
parents:
16677
diff
changeset
|
228 | * not found. |
| 6846 | 229 | */ |
|
16421
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
230 | PurpleBuddyIcon * |
|
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15997
diff
changeset
|
231 | purple_buddy_icons_find(PurpleAccount *account, const char *username); |
| 6846 | 232 | |
| 233 | /** | |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
234 | * Returns the buddy icon image for an account. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
235 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
236 | * The caller owns a reference to the image in the store, and must dereference |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
237 | * the image with purple_imgstore_unref() for it to be freed. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
238 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
239 | * This function deals with loading the icon from the cache, if |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
240 | * needed, so it should be called in any case where you want the |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
241 | * appropriate icon. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
242 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
243 | * @param account The account |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
244 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
245 | * @return The account's buddy icon image. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
246 | */ |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
247 | PurpleStoredImage * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
248 | purple_buddy_icons_find_account_icon(PurpleAccount *account); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
249 | |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
250 | /** |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
251 | * Sets a buddy icon for an account. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
252 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
253 | * This function will deal with saving a record of the icon, |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
254 | * caching the data, etc. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
255 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
256 | * @param account The account for which to set a custom icon. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
257 | * @param icon_data The image data of the icon, which the |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
258 | * buddy icon code will free. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
259 | * @param icon_len The length of the data in @a icon_data. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
260 | * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
261 | * @return The icon that was set. The caller does NOT own |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
262 | * a reference to this, and must call purple_imgstore_ref() |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
263 | * if it wants one. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
264 | */ |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
265 | PurpleStoredImage * |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
266 | purple_buddy_icons_set_account_icon(PurpleAccount *account, |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
267 | guchar *icon_data, size_t icon_len); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
268 | |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
269 | /** |
|
16677
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
270 | * Returns the timestamp of when the icon was set. |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
271 | * |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
272 | * This is intended for use in protocols that require a timestamp for |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
273 | * buddy icon update reasons. |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
274 | * |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
275 | * @param account The account |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
276 | * |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
277 | * @return The time the icon was set, or 0 if an error occurred. |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
278 | */ |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
279 | time_t |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
280 | purple_buddy_icons_get_account_icon_timestamp(PurpleAccount *account); |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
281 | |
|
7cd57586cdbf
The OSCAR timestamp stuff.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
282 | /** |
|
23283
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
283 | * Returns a boolean indicating if a given blist node has a custom buddy icon. |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
284 | * |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
285 | * @param node The blist node. |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
286 | * |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
287 | * @return A boolean indicating if @a node has a custom buddy icon. |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
288 | */ |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
289 | gboolean |
|
34699
09b2c9219b57
Renamed PurpleBlistNode to PurpleBListNode
Ankit Vani <a@nevitus.org>
parents:
33665
diff
changeset
|
290 | purple_buddy_icons_node_has_custom_icon(PurpleBListNode *node); |
|
23283
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
291 | |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
292 | /** |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
293 | * Returns the custom buddy icon image for a blist node. |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
294 | * |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
295 | * The caller owns a reference to the image in the store, and must dereference |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
296 | * the image with purple_imgstore_unref() for it to be freed. |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16534
diff
changeset
|
297 | * |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
298 | * This function deals with loading the icon from the cache, if |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
299 | * needed, so it should be called in any case where you want the |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
300 | * appropriate icon. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
301 | * |
|
23283
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
302 | * @param node The node. |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
303 | * |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
304 | * @return The custom buddy icon. |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
305 | */ |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
306 | PurpleStoredImage * |
|
34699
09b2c9219b57
Renamed PurpleBlistNode to PurpleBListNode
Ankit Vani <a@nevitus.org>
parents:
33665
diff
changeset
|
307 | purple_buddy_icons_node_find_custom_icon(PurpleBListNode *node); |
|
23283
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
308 | |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
309 | /** |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
310 | * Sets a custom buddy icon for a blist node. |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
311 | * |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
312 | * This function will deal with saving a record of the icon, caching the data, |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
313 | * etc. |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
314 | * |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
315 | * @param node The blist node for which to set a custom icon. |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
316 | * @param icon_data The image data of the icon, which the buddy icon code will |
|
24273
f5b589130c88
Don't try to read data from a NULL filename in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23337
diff
changeset
|
317 | * free. Use NULL to unset the icon. |
|
23283
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
318 | * @param icon_len The length of the data in @a icon_data. |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
319 | * |
|
23283
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
320 | * @return The icon that was set. The caller does NOT own a reference to this, |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
321 | * and must call purple_imgstore_ref() if it wants one. |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
322 | */ |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
323 | PurpleStoredImage * |
|
34699
09b2c9219b57
Renamed PurpleBlistNode to PurpleBListNode
Ankit Vani <a@nevitus.org>
parents:
33665
diff
changeset
|
324 | purple_buddy_icons_node_set_custom_icon(PurpleBListNode *node, |
|
23283
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
325 | guchar *icon_data, size_t icon_len); |
|
93261f547412
Add the purple_buddy_icons_node_has_custom_icon,
Etan Reisner <deryni@pidgin.im>
parents:
22763
diff
changeset
|
326 | |
|
23285
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
327 | /** |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
328 | * Sets a custom buddy icon for a blist node. |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
329 | * |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
330 | * Convenience wrapper around purple_buddy_icons_node_set_custom_icon. |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
331 | * @see purple_buddy_icons_node_set_custom_icon() |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
332 | * |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
333 | * @param node The blist node for which to set a custom icon. |
|
24273
f5b589130c88
Don't try to read data from a NULL filename in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23337
diff
changeset
|
334 | * @param filename The path to the icon to set for the blist node. Use NULL |
|
f5b589130c88
Don't try to read data from a NULL filename in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23337
diff
changeset
|
335 | * to unset the custom icon. |
|
23285
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
336 | * |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
337 | * @return The icon that was set. The caller does NOT own a reference to this, |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
338 | * and must call purple_imgstore_ref() if it wants one. |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
339 | */ |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
340 | PurpleStoredImage * |
|
34699
09b2c9219b57
Renamed PurpleBlistNode to PurpleBListNode
Ankit Vani <a@nevitus.org>
parents:
33665
diff
changeset
|
341 | purple_buddy_icons_node_set_custom_icon_from_file(PurpleBListNode *node, |
|
23285
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
342 | const gchar *filename); |
|
da6c923a5305
Add a purple_buddy_icons_node_set_custom_icon_from_file convenience function.
Etan Reisner <deryni@pidgin.im>
parents:
23283
diff
changeset
|
343 | |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16421
diff
changeset
|
344 | /** |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
345 | * Sets whether or not buddy icon caching is enabled. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
346 | * |
| 33663 | 347 | * @param caching TRUE if buddy icon caching should be enabled, or |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
348 | * FALSE otherwise. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
349 | */ |
| 15884 | 350 | void purple_buddy_icons_set_caching(gboolean caching); |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
351 | |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
352 | /** |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
353 | * Returns whether or not buddy icon caching should be enabled. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
354 | * |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
355 | * The default is TRUE, unless otherwise specified by |
| 15884 | 356 | * purple_buddy_icons_set_caching(). |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
357 | * |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
358 | * @return TRUE if buddy icon caching is enabled, or FALSE otherwise. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
359 | */ |
| 15884 | 360 | gboolean purple_buddy_icons_is_caching(void); |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
361 | |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
362 | /** |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
363 | * Sets the directory used to store buddy icon cache files. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
364 | * |
|
7114
6e5e4e674496
[gaim-migrate @ 7681]
Christian Hammond <chipx86@chipx86.com>
parents:
6886
diff
changeset
|
365 | * @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
|
366 | */ |
| 15884 | 367 | void purple_buddy_icons_set_cache_dir(const char *cache_dir); |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
368 | |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
369 | /** |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
370 | * Returns the directory used to store buddy icon cache files. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
371 | * |
| 15884 | 372 | * The default directory is PURPLEDIR/icons, unless otherwise specified |
| 373 | * by purple_buddy_icons_set_cache_dir(). | |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
374 | * |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
375 | * @return The directory to store buddy icon cache files to. |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
376 | */ |
| 15884 | 377 | const char *purple_buddy_icons_get_cache_dir(void); |
|
6886
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
378 | |
|
97734a57c0f5
[gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents:
6869
diff
changeset
|
379 | /** |
| 6846 | 380 | * Returns the buddy icon subsystem handle. |
| 381 | * | |
| 382 | * @return The subsystem handle. | |
| 383 | */ | |
| 15884 | 384 | void *purple_buddy_icons_get_handle(void); |
| 6846 | 385 | |
| 386 | /** | |
| 387 | * Initializes the buddy icon subsystem. | |
| 388 | */ | |
| 15884 | 389 | void purple_buddy_icons_init(void); |
| 6846 | 390 | |
| 391 | /** | |
| 392 | * Uninitializes the buddy icon subsystem. | |
| 393 | */ | |
| 15884 | 394 | void purple_buddy_icons_uninit(void); |
| 6846 | 395 | |
| 396 | /*@}*/ | |
| 397 | ||
| 10483 | 398 | /**************************************************************************/ |
| 399 | /** @name Buddy Icon Helper API */ | |
| 400 | /**************************************************************************/ | |
| 401 | /*@{*/ | |
| 402 | ||
| 403 | /** | |
| 404 | * Gets display size for a buddy icon | |
| 405 | */ | |
| 15884 | 406 | void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height); |
| 10483 | 407 | |
| 408 | /*@}*/ | |
| 409 | ||
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32305
diff
changeset
|
410 | G_END_DECLS |
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
12323
diff
changeset
|
411 | |
| 15884 | 412 | #endif /* _PURPLE_BUDDYICON_H_ */ |