Mercurial > pidgin
annotate src/imgstore.h @ 8773:1d7416e8db5f
[gaim-migrate @ 9534]
for datallah with love
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Fri, 23 Apr 2004 15:48:21 +0000 |
parents | fa6395637e2c |
children | 4ff4c34b7500 |
rev | line source |
---|---|
6982 | 1 /** |
2 * @file imgstore.h IM Image Store API | |
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. | |
6982 | 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 * | |
25 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
26 #ifndef _GAIM_CONV_IMGSTORE_H_ |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
27 #define _GAIM_CONV_IMGSTORE_H_ |
6982 | 28 |
29 /** | |
30 * Stored image | |
31 * | |
32 * Represents a single IM image awaiting display and/or transmission. | |
33 */ | |
34 typedef struct | |
35 { | |
36 char *data; /**< The image data. */ | |
37 size_t size; /**< The image data's size. */ | |
38 char *filename; /**< The filename (for the UI) */ | |
39 } GaimStoredImage; | |
40 | |
41 #ifdef __cplusplus | |
42 extern "C" { | |
43 #endif | |
44 | |
45 /** | |
46 * Add an image to the store. The caller owns a reference | |
47 * to the image in the store, and must dereference the image | |
48 * with gaim_imgstore_unref for it to be freed. | |
49 * | |
50 * @param data Pointer to the image data. | |
51 * @param size Image data's size. | |
52 * @param filename Filename associated with image. | |
53 | |
54 * @return ID for the image. | |
55 */ | |
56 int gaim_imgstore_add(const void *data, size_t size, const char *filename); | |
57 | |
58 /** | |
59 * Retrieve an image from the store. The caller does not own a | |
60 * reference to the image. | |
61 * | |
62 * @param id The ID for the image. | |
63 * | |
64 * @return A pointer to the requested image, or NULL if it was not found. | |
65 */ | |
66 GaimStoredImage *gaim_imgstore_get(int id); | |
67 | |
68 /** | |
69 * Increment the reference count for an image in the store. The | |
70 * image will be removed from the store when the reference count | |
71 * is zero. | |
72 * | |
73 * @param id The ID for the image. | |
74 */ | |
75 void gaim_imgstore_ref(int id); | |
76 | |
77 /** | |
78 * Decrement the reference count for an image in the store. The | |
79 * image will be removed from the store when the reference count | |
80 * is zero. | |
81 * | |
82 * @param id The ID for the image. | |
83 */ | |
84 void gaim_imgstore_unref(int id); | |
85 | |
86 #ifdef __cplusplus | |
87 } | |
88 #endif | |
89 | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
90 #endif /* _GAIM_CONV_IMGSTORE_H_ */ |